HenrikJoreteg / hjs-webpack

Helpers/presets for setting up webpack with hotloading react and ES6(2015) using Babel.
1.79k stars 127 forks source link

Honor the plugins option in postcss.config.js #327

Closed wkillerud closed 7 years ago

wkillerud commented 7 years ago

This is a proposed solution for issue #326

Look for a postcss.config.js file in the cwd of the process running hjs-webpack (typically the same as package.json where PostCSS expects the file to be) and use it to build the options given to the loader.

This change lets users define custom PostCSS-plugins via postcss.config.js instead of modifying the config generated by hjs-webpack.

wkillerud commented 7 years ago

I was torn between this being a bugfix or a new feature but landed on the latter since this probaly wasn't an intended use case before. If you feel strongly otherwise I'll update the PR :)

selbekk commented 7 years ago

Great job @wkillerud :+1: The postcss case is a bit hard to solve - but your solution seemed pretty decent!

LGTM - I'll leave it up for a day or so before merging, to make sure all the other contributors have had time to have had a look.