Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite: Include user config optimizeDeps in final optimizeDeps #20313

Merged
merged 2 commits into from
Dec 19, 2022

Conversation

agarun
Copy link
Contributor

@agarun agarun commented Dec 16, 2022

Issue:

What I did

currently: If a dev specifies optimizeDeps in their custom vite config, it will be ignored by @storybook/build-vite. I would consider this a bug, because a custom config should still be supported where possible

now: I spread optimizeDeps into the final object so it will update the config as expected

just for demonstration (my weird use case): here I create a custom vite config where optimizeDeps.esbuildOptions forces .js files to be read as .jsx

image

with this PR it will be included in the final config:

image

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

@agarun agarun changed the title Include user config optimizeDeps in final optimizeDeps builder-vite: Include user config optimizeDeps in final optimizeDeps Dec 16, 2022
Copy link
Member

@yannbf yannbf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @agarun thanks a lot for your contributiont! LGTM

@yannbf yannbf changed the title builder-vite: Include user config optimizeDeps in final optimizeDeps Vite: Include user config optimizeDeps in final optimizeDeps Dec 19, 2022
@yannbf yannbf merged commit a2b8fb9 into storybookjs:next Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants