@wordpress/scripts and Gutenberg
-
I have tried using webpack before and always found it frustrating, verging on incomprehensible, and eventually gave up with it. So I was delighted to see @wordpress/scripts, which I have managed to get running without any trouble, successfully sorting out my js and scss/css.
However, although it is working well, such as it is, I am having trouble getting it to work well with Gutenberg.
@wordpress/scripts ‘out of the box’ only outputs a single css file. While a single css file might be ok for sites made with Classic editor, for Gutenberg you need separate css for the front end and for the Gutenberg previews. For example, you don’t want to bring all the css for the header and footer into the back end – you only want the css specific to your blocks.
So, is there a way to use @wordpress/scripts which will let you have all the different, separate css files you need – or am I barking up the wrong tree? I am ok with HTML, scss, PHP and basic front end javascript, but webpack makes my head spin!
- The topic ‘@wordpress/scripts and Gutenberg’ is closed to new replies.