Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack live reload working? #37

Closed
jschr opened this issue Dec 11, 2015 · 3 comments
Closed

webpack live reload working? #37

jschr opened this issue Dec 11, 2015 · 3 comments

Comments

@jschr
Copy link

jschr commented Dec 11, 2015

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')
]
@duncanbeevers
Copy link
Contributor

@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.

@chrishoage
Copy link

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.

@ai
Copy link
Member

ai commented Jul 21, 2016

Sorry, this question for webpack users. I didn’t use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants