Gutenberg Static blocks: viewScript doesn’t import css for frontend?
I didn’t declare the viewStyle for frontend and thus the css wasn’t being enqueued. { “viewStyle”: [ “file:./view.css”, “example-view-style” ] } build/view.css had all the needed css for swiper – it just wasn’t being declared with viewStyle https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#view-style . view.css: /*!*******************************************************************************************************************************************************************************************!*\ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/swiper/swiper-bundle.css ***! \*******************************************************************************************************************************************************************************************/ /** * Swiper 11.0.7 * Most modern mobile touch … Read more