react-webpack-generators / react-webpack-template

Simple react webpack template
MIT License
82 stars 44 forks source link

Add PostCSS support #12

Closed VovanR closed 8 years ago

VovanR commented 8 years ago

Related to https://github.com/newtriks/generator-react-webpack/issues/163 I use it in my playground project react-color-palette based on generator-react-webpack

weblogixx commented 8 years ago

We could include it, but I opt for not adding it to the regular .css selector of webpack, because that would cause too much overhead for people that dont use it. What do you think about adding its own chain via .pss?

stylesuxx commented 8 years ago

Ahh, this is awesome.

Just to drop my two cents, we could leave the css extension and just let people enable postcss via generator. If it is enabled we just add the pipe similar as pushed by @VovanR otherwise we leave it as it is.

This would also work with all other css "flavours" like less, and sass since postcss can be the last element in all of the CSS processing pipelines.

Imho this has the upside, that users do not have to fiddle to get their editor to properly highlight the css when it has a *.pss extension and also it does not really introduce any overhead.

Edit: OK, I just saw I am talking bullshit, since the template is a dependency and not build while generation it can not be done as suggested by me. Still, the dependency may be installed from generator-react-webpack if the user chooses to - just need a way to adapt the webpack config in the template then.

weblogixx commented 8 years ago

@VovanR: we have included (basic) PostCSS support in generator-react-webpack, so the user will be able to switch it on or off, depending on his needs. I currently do not plan to add it to the base generator.