-
Hi, Since most blocks, and the theme as a whole shares 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:
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! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Okay, I figured out something that works: const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const cleanedDefaultPlugins = defaultConfig.plugins.filter(
(plugin) => {
if (['RtlCssPlugin'].includes(plugin.constructor.name)) {
return false;
}
return true;
}
);
module.exports = {
...defaultConfig,
plugins: [
...cleanedDefaultPlugins,
],
optimization: {
...defaultConfig.optimization,
splitChunks: {
cacheGroups: {
styles: {
name: "style",
type: "css/mini-extract",
chunks: "all",
enforce: true,
},
},
},
},
}; |
Beta Was this translation helpful? Give feedback.
Okay, I figured out something that works: