webpack live reload working?
jschr opened this issue · 3 comments
Has anyone got webpack live reload working with postcss-simple-vars?
Looks like it should work according to #8 but I can't seem to get it going. Changes made to variables.js
aren't reflected until I restart webpack dev server.
My webpack config file looks like:
module: {
loaders: [
...
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader') }
]
},
postcss: () => [
require('postcss-discard-comments'),
require('postcss-simple-vars')({ variables: () => require('./src/theme/variables') }),
require('postcss-calc'),
require('postcss-nested'),
require('autoprefixer')
]
@jschr I'm seeing the same thing. I also tried replacing require
with an equivalent require-nocache
invocation and saw no change reflected in the browser.
I was only able to get it to work under the following conditions: 1) All files must be required separately that included in a flat manner. 2) require-nocache
be used to import all of the files. 3) A file using the variable must be saved (even if nothing has changed) in order for the variable change to be picked up.
Sorry, this question for webpack users. I didn’t use it.