Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

storybook-addon-swc

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storybook-addon-swc

Storybook add-on to enable SWC builds.

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
56K
increased by21.24%
Maintainers
1
Weekly downloads
 
Created
Source

storybook-addon-swc

npm version codecov license Github Twitter

Storybook addon that improves build time by building with swc.

🗒 Examples

🚀 Installation

$ npm install -D storybook-addon-swc @swc/core

👏 Getting Started

Edit the .storybook/main.js file and register the addon.

module.exports = {
  addons: [
    'storybook-addon-swc',
  ],
};

🔧 Configurations

Additional configuration options can be passed as needed.

module.exports = {
  addons: [
    {
      name: 'storybook-addon-swc',
      options: {
        enable: true,
        enableSwcLoader: true,
        enableSwcMinify: true,
        swcLoaderOptions: {},
        swcMinifyOptions: {},
      },
    },
  ],
};

Options

NameDescriptionTypeDefault Value
enableIf set to false, this add-on will be disabled.booleantrue
enableSwcLoaderIf set to false, swc-loader is disabled and babel-loader is used.booleantrue
enableSwcMinifyIf set to false, minify using swc is disabled and minify using conventional terser is used.booleantrue
swcLoaderOptionsOptions for swc loader.objectsee
swcMinifyOptionsOptions for swc minify.objectsee

SWC Plugins

The SWC plugins feature is still experimental, but can be used by changing the settings as follows.

module.exports = {
  addons: [
    {
      name: 'storybook-addon-swc',
      options: {
        swcLoaderOptions: {
          jsc: {
            experimental: {
              plugins: [['plugin-name', {}]],
            },
          },
        },
      },
    },
  ],
};

🎓 Alternative

storybook-addon-turbo-build

This add-on replaces babel-loader with esbuild-loader.
It was used as a reference in the development of storybook-addon-swc.

storybook-builder-vite

This builder changes the build system of Storybook from Webpack to Vite.
Vite is very fast because it does not bundle during development.

🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check issues page if you want to contribute.

📝 License

Copyright © 2020 @Karibash.

This project is MIT licensed.

Keywords

FAQs

Package last updated on 18 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc