Skip to content

Docs: Explain Vite build option handling - #36361

Merged
jonniebigodes merged 2 commits into
storybookjs:nextfrom
erenbati:docs/vite-build-options-28189
Oct 13, 2026
Merged

jonniebigodes merged 2 commits into
storybookjs:nextfrom
erenbati:docs/vite-build-options-28189

Conversation

@erenbati

Copy link
Copy Markdown
Contributor

Closes #28189

What I did

Added an info callout to the Vite builder documentation explaining that Storybook does not inherit most build options from vite.config.js|ts.

The docs now clarify that:

  • build.target is carried over from the user's Vite config.
  • Other Storybook-specific build options, such as build.chunkSizeWarningLimit or build.commonjsOptions, should be configured through viteFinal in .storybook/main.js|ts.

This matches the current builder implementation, which removes the user's build object before merging the rest of the Vite config and only restores build.target.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This is a documentation-only change and does not modify runtime behavior.

To review it:

  1. Open the Vite builder documentation page.
  2. Confirm the new info callout appears in the Configuration section before the viteFinal example.
  3. Confirm the wording matches the current behavior in code/builders/builder-vite/src/vite-config.ts.

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update MIGRATION.MD

AI disclosure

ChatGPT assisted with repository research, collision checking, and drafting this documentation change. I reviewed and approved the final one-file diff and can respond to review feedback.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d98c5411-d20d-4139-bffe-2390ea8a5f26
📥 Commits

Reviewing files that changed from the base of the PR and between 49a91bf and 3535857.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ae8b1846-cde2-44be-843e-fe6868425aed

📥 Commits

Reviewing files that changed from the base of the PR and between 6643f31 and 49a91bf.

📒 Files selected for processing (1)
  • docs/builders/vite.mdx

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The Vite builder documentation now states that Storybook inherits only Vite’s build.target option. It directs users to configure other production build options through viteFinal.

Changes

Vite build option documentation

Layer / File(s) Summary
Document Vite build option handling
docs/builders/vite.mdx
Added a callout that identifies build.target as the inherited Vite build option and directs other production build configuration to viteFinal.

Priority: ⬇️ Low

Severity of issue fixed: Medium

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@storybook-contribution-review storybook-contribution-review Bot added documentation configuration builder-vite qa:skip Pull Requests that do not need any QA. (e.g. documentation) sev:S3 Medium priority. Fix within months if possible. review:3-verification Stage 2 passed: awaiting stage 3 proof-of-work verification review:verified Three-step review passed: architecture, code quality, runtime verification and removed review:3-verification Stage 2 passed: awaiting stage 3 proof-of-work verification labels Sep 23, 2026
@storybook-contribution-review

Copy link
Copy Markdown

🤖 I am the Storybook contribution review bot; a human maintainer approved this message before it was posted.
Review phase: Final verdict - runtime verification complete (architecture and code quality stages skipped for a trivial diff)

We are trying out something new: a three-stage automated review - architecture, then code quality, then runtime verification - that runs on a PR before a human maintainer looks at it closely. A maintainer still reads this and still makes the call; the aim is that by the time they do, the reachability and evidence work is already done. Tell us how it lands for you, that feedback is genuinely useful to us right now.

Thank you for documenting this easy-to-miss Vite boundary. Runtime verification supplied build.target, build.chunkSizeWarningLimit, and build.commonjsOptions through the user Vite config. Storybook carried over only build.target. Supplying the other two settings through viteFinal kept both values in the configuration passed to Vite.

The focused base-and-head run passed 14 of 14 tests across two files. yarn docs:check and the formatter check for docs/builders/vite.mdx also passed. The new callout is an explicit exception to the preceding general Vite configuration guidance, so the two paragraphs are coherent.

This is a documentation-only change, so the architecture and code-quality stages were skipped. The verification passed at head 49a91bf97baf4303368726872b0984453c2bd41c. I am marking this contribution verified and ready for a human maintainer's final merge decision.

@jonniebigodes jonniebigodes added the ci:docs Run the CI jobs for documentation checks only. label Oct 13, 2026
@jonniebigodes

Copy link
Copy Markdown
Contributor

@erenbati thanks for taking the time to put together this pull request and helping us improve the documentation. Appreciate it 🙏 !

I've checked and it looks good on my end.

Merging

@jonniebigodes
jonniebigodes merged commit 1921070 into storybookjs:next Oct 13, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-scan:human builder-vite ci:docs Run the CI jobs for documentation checks only. configuration documentation qa:skip Pull Requests that do not need any QA. (e.g. documentation) review:verified Three-step review passed: architecture, code quality, runtime verification sev:S3 Medium priority. Fix within months if possible.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Documentation]: Vite's build options are silently ignored

2 participants