Skip to content

Commit

Permalink
Enable hot reloading of imported stylesheets (#400)
Browse files Browse the repository at this point in the history
Initializes postcss as a function with the wp argument
passed in. This allows to use the 'addDependencyTo' option
of postcss-import plugin so that hot reloading will work
properly with imported stylesheets.
  • Loading branch information
andrewcoelho authored and KyleAMathews committed Aug 24, 2016
1 parent c06475a commit 89d05f2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,14 @@ module.exports = (program, directory, suppliedStage, webpackPort = 1500, routes
})

config.merge({
postcss: [
require('postcss-import')(),
require('postcss-cssnext')({ browsers: 'last 2 versions' }),
require('postcss-browser-reporter'),
require('postcss-reporter'),
],
postcss (wp) {
return [
require('postcss-import')({ addDependencyTo: wp }),
require('postcss-cssnext')({ browsers: 'last 2 versions' }),
require('postcss-browser-reporter'),
require('postcss-reporter'),
]
},
})
return config

Expand Down

0 comments on commit 89d05f2

Please sign in to comment.