postcss / postcss-load-config

Autoload Config for PostCSS
MIT License
645 stars 73 forks source link

Using loader.addDependency inside config #134

Closed franciscolourenco closed 6 years ago

franciscolourenco commented 6 years ago

Problem

Plugins like postcss-simple-vars or postcss-properties etc allow variables to be specified. These variables are usually imported from other files. Even though webpack reloads when postcss.config.js is modifier, the same doesn't happen for variable files imported in postcss.config.js. Is there a way to access loader.addDependency so that imported files can be added manually? Or is there another way to achieve this?

michael-ciniawsky commented 6 years ago

postcss-loader >= 2.1.4 restored the loader context on the config.ctx, so addDependecy should be available now (ctx.webpack.addDependency)