fix: emit block-library-style.css for CTA block frontend styles (#1198)#1219
fix: emit block-library-style.css for CTA block frontend styles (#1198)#1219danieliser wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (2)
✅ Files skipped from review due to trivial changes (2)
WalkthroughThe PR creates a root-level ChangesBlock Library Root-Level Style Entrypoint
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Remove LimitChunkCountPlugin so splitChunks can separate frontend style.scss from editor.scss, add a root block-library style entry point, and fix MiniCssExtractPlugin chunk naming for unnamed style chunks.
8000a9a to
7df2996
Compare
Summary
Closes #1198.
Built and confirmed the bug on
1.22.0:The release registers/enqueues
dist/packages/block-library-style.css, but webpack never emitted that file.Root cause:
LimitChunkCountPlugin(maxChunks: 1) preventedsplitChunksfrom separating frontendstyle.scssinto its own CSS artifact. The oldMiniCssExtractPluginfilename logic also checkedchunk.name.includes('style'), which never matched the unnamed style-split chunks.Generation fix (already on develop via b920b65):
LimitChunkCountPluginsplitChunks.cacheGroups.styleforstyle.scssimportsMiniCssExtractPlugin/RtlCssPluginto emit{runtime}-style.cssfor unnamed style chunksVerified after fix:
This PR adds: a root
packages/block-library/src/style.scssentry point (per issue recommendation) imported fromsrc/index.ts, consolidating frontend block styles so webpack reliably picks them up for the-style.csssplit.Test plan
NODE_ENV=production npm run buildon branch producesdist/packages/block-library-style.cssblock-library-style.csscontains frontend CTA selectors (e.g..wp-block-popup-maker-cta-button__link)block-library.csscontains editor-only styles (~1.6KB)popup-maker-block-library-stylewithout 404Summary by CodeRabbit