Repository navigation
Reuse PostCSS browser resolver in Storybook smoke tests - #83635
Merged
Merged
Conversation
🤖 PR meta 🤖📦 Bundle sizeSize Change: 0 B Total Size: 8.24 MB
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Mamaduka
approved these changes
Sep 28, 2026
9 of 18 tasks
ciampo
force-pushed
the
codex/83611-storybook-postcss-browser
branch
from
September 28, 2026 21:47
0e84d4c to
27fb60c
Compare
widoz
pushed a commit
to widoz/gutenberg
that referenced
this pull request
Oct 2, 2026
…3635) Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #83611 and vitejs/vite#23512.
What?
Reuse the PostCSS browser import resolver in Storybook's dependency optimizer. A cold Storybook smoke run now has zero browser-externalization messages instead of 230.
Why?
PostCSS marks optional Node imports as
browser: false, but Vite still exposes warning-producing browser externals for them. The existing Browser Mode resolver already handles only those imports from PostCSS.How?
Move the resolver into Storybook's private config so Storybook and Browser Mode share it. Add it only to Storybook's dependency optimization. Imports outside PostCSS still use Vite's normal resolution.
Testing Instructions
npm run --workspace @wordpress/storybook test:smoke. Confirm all 233 files and 875 stories pass without browser-externalization messages.node node_modules/vitest/vitest.mjs run --config test/unit/vitest.config.mjs --project browser test/unit/config/postcss.browser.test.jsand confirm the existing PostCSS regression test passes.Use of AI Tools
Codex drafted the change and PR description. I reviewed the diff and verified the cold Storybook run, build, Browser Mode test, typecheck, and lint.