Docs
Storybook Docs

swc

Parent: main.js|ts configuration

Type: (config: swc.Options, options: Options) => swc.Options | Promise<swc.Options>

Customize Storybook's SWC setup for Webpack-based projects enabled via the @storybook/addon-webpack5-compiler-swc addon based on the supported frameworks, except Angular, Create React App, Ember.js and Next.js.

.storybook/main.js
export default {
  framework: {
    name: '@storybook/your-framework',
    options: {},
  },
  swc: (config, options) => {
    return {
      ...config,
      // Apply your custom SWC configuration
    };
  },
};

SWC.Options

The options provided by SWC are only applicable if you've enabled the @storybook/addon-webpack5-compiler-swc addon.

Options

Type: { configType?: 'DEVELOPMENT' | 'PRODUCTION' }

There are other options that are difficult to document here. Please introspect the type definition for more information.

Join the community

6,378 developers and counting
Open source software
Maintained by
Chromatic
Special thanks to Netlify and CircleCi