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

@storybook/builder-vite

Package Overview
Dependencies
Maintainers
11
Versions
861
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/builder-vite

A plugin to run and build Storybooks with Vite

  • 0.0.0-pr-29476-sha-18b82d85
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9M
increased by5.96%
Maintainers
11
Weekly downloads
 
Created

What is @storybook/builder-vite?

The @storybook/builder-vite package is a Storybook builder that integrates Vite as the build tool for Storybook. It allows developers to leverage Vite's fast build times and features within their Storybook environment. This package is particularly useful for projects that are already using Vite and want to maintain consistency in their build tools.

What are @storybook/builder-vite's main functionalities?

Custom Vite Configuration

Allows customization of the Vite configuration used by Storybook. Developers can add aliases, plugins, and modify other settings to tailor the build process.

module.exports = {
  stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
  addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
  core: {
    builder: '@storybook/builder-vite'
  },
  async viteFinal(config, { configType }) {
    // customize the Vite config here
    config.resolve.alias = {
      ...config.resolve.alias,
      '@components': '/path/to/components'
    };
    // return the customized config
    return config;
  }
};

Fast Build Times

By using Vite as the build tool, Storybook can take advantage of Vite's fast build times, leading to quicker startup and refresh times during development.

// There is no specific code sample for this feature as it is an inherent benefit of using Vite with Storybook.

Support for Vite Plugins

Enables the use of Vite plugins within the Storybook build process, allowing developers to extend functionality with Vite's rich plugin ecosystem.

module.exports = {
  core: {
    builder: '@storybook/builder-vite'
  },
  async viteFinal(config) {
    config.plugins.push(myVitePlugin());
    return config;
  }
};

Other packages similar to @storybook/builder-vite

FAQs

Package last updated on 30 Oct 2024

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