fix(builder-vite): avoid duplicate publicDir copies with staticDirs#34524
fix(builder-vite): avoid duplicate publicDir copies with staticDirs#34524harshit-d3v wants to merge 1 commit intostorybookjs:nextfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThese changes add logic to Storybook's Vite builder to conditionally disable Vite's Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 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 |
|
Hi @harshit-d3v, Due to a recent high volume of unreviewed AI-generated PRs, we are requesting verification and proof that the implemented fix actually works. Please provide a simple GIF/Video or image of how the fix works, optimally with before-and-after comparisons. Thank you for your understanding! |
Hi @valentinpalkovic, thanks for flagging this. I verified this locally and attached a simple before/after screenshot. This PR fixes the case where Vite's After this fix, Storybook disables Vite's I also verified the regression tests locally with Result: |

Summary
publicDircopy when StorybookstaticDirsalready includes the same directorypublic/index.jsoncan overwrite Storybook's generatedstorybook-static/index.jsonpublicDirvalues, plus build vs development behaviorCloses #24627.
Testing
yarn vitest run code/builders/builder-vite/src/vite-config.test.tsSummary by CodeRabbit
Tests
Bug Fixes