gcorne / wp-react-boilerplate

Get started with using React in a WordPress plugin
129 stars 27 forks source link

Multiple stylesheets with SCSS #8

Closed jamigibbs closed 7 years ago

jamigibbs commented 7 years ago

I can't seem to get multiple SCSS files to compile into /build/style.css. When I require stylesheets in different components, only the stylesheet in /components/widgets/ will compile (I'm trying to do this for a component that's not the widget). Maybe I'm just not clear on how to add other stylesheets?

gcorne commented 7 years ago

@jamigibbs Thanks for giving this a spin. I tweaked the webpack config to show how multiple multiple css files can be generated. Now if an .scss file is required in any module that is a dependency of admin.js it will be extracted into admin.css. Make sense?

jamigibbs commented 7 years ago

This is great! Thanks for doing that!