How can I combine multiple CSS files into one when using wp-scripts?
-
Hi,
We are developing a block theme with the use of wp-scripts together with Tailwind.
I’m still trying to figure out how to set everything up correctly, and need some assistance regarding the generated css files.Since most blocks (and the theme as a whole) share a lot of tailwind classes, I would like all css to end up in one css file in the build folder.
Our
src
folder currently has the flowing structure:src/
├─ blocks/
│ ├─ [block name]/
│ │ ├─ edit.js
│ │ ├─ index.js
├─ css/
│ ├─ style.css
│ ├─ edit.cssedit.js
andindex.js
importsedit.css
andstyle.css
respectively.
I would like for the generated css to be in two css files like this as well, but when I runwp-scripts build
I end up with several css files in each blocks folder.I think this might be an issue that I can solve by changing the webpack config (I’m using the default right now), but I don’t have enough experience with webpack to know what to change. So any help is appreciated!
- You must be logged in to reply to this topic.