Skip to content

fix: streamline SWC options handling in webpackFinal #13

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

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Dec 30, 2024

Closes #10
Closes #7

Storybook documentation suggests you can customize the swc config, by a function that accepts the default config:

swc: (config: Options, options): Options => {
    return {
      ...config,
      // Apply your custom SWC configuration
    };
  },

config is an empty object, though. In this PR, deep merging the user's settings with the SWC default options no longer happens. Instead, the default SWC loader settings are passed as options into the swc preset function, and the user is responsible for returning the whole SWC configuration from the preset hook. This can lead to a breaking change!

📦 Published PR as canary version: 2.0.0--canary.13.b38e7cf.0

✨ Test out this PR locally via:

npm install @storybook/[email protected]
# or 
yarn add @storybook/[email protected]

@valentinpalkovic valentinpalkovic added the major Increment the major version when merged label Dec 30, 2024
@valentinpalkovic valentinpalkovic self-assigned this Dec 30, 2024
@valentinpalkovic valentinpalkovic merged commit 8976adf into main Dec 30, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Increment the major version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't extend jsc parser options [Bug] Errors upgrading to v1.0.4
1 participant