-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Variables hot reloading #75
Comments
Hi. You need to open issue in postcss-loader. |
@ai |
They are supported by postcss-loader. It reads a config. So I have no idea how to fix it in this plugin 🤷♂️ |
One way to do it would be to receive file(s) path(s) instead of an object. That way you could you could do |
Yeap. I will think about it on next weekend. |
For anyone still having this issue, it's solvable by using the Example loader definition {
loader: 'postcss-loader',
options: {
plugins: function(loader) {
const colors = require.resolve('./colors.js');
loader.addDependency(colors);
delete require.cache[colors];
return [
simpleVars({
variables: function() {
return require(colors);
},
}),
];
},
},
} |
The variables seem to be updated, but only after restarting webpack dev server.
postcss.config.js
seems to be added as a loader dependency by default, which means that editing this file causes webpack to recompile. However the variable files imported inpostcss.config.js
don't. Is there a way to access the loader inpostcss.config.js
in order to calladdDependency
with the variable files?Otherwise how is the reloading supposed to work?
The text was updated successfully, but these errors were encountered: