Registry / devops / storybook-addon-turbo-build

storybook-addon-turbo-build

JSON →
library2.0.1jsnpmunverified

storybook-addon-turbo-build is a Storybook addon designed to improve the build performance of Storybook v6 projects. It achieves this by modifying webpack configurations, primarily by replacing Terser with ESBuild for minification and optionally disabling source map generation. The current stable version is 2.0.1, which includes minor bug fixes. Major version 2.0.0 upgraded the underlying `esbuild-loader`. While it can significantly reduce cold build times (builds without `node_modules/.cache`), its impact on cache-enabled builds might be less noticeable, requiring users to evaluate its benefits for their specific workflow. The addon is explicitly incompatible with Storybook v7 and later versions, as those versions incorporate their own performance improvements (e.g., Vite integration, webpack 5), rendering this addon obsolete for newer Storybook setups. Its release cadence is tied to updates in its underlying dependencies like `esbuild-loader` and critical bug fixes for Storybook v6 compatibility.

npm install storybook-addon-turbo-build
INSTALL
IMPORT
SIG · STORYBOOK-ADDON-TU
S
storybook-addon-turbo-build
devopsjavascriptv2.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Addon Configuration (String)
module.exports = { addons: [ "storybook-addon-turbo-build" ] };
import { configure } from 'storybook-addon-turbo-build';
The addon is configured as a string in `.storybook/main.js` and does not expose exportable symbols for direct JavaScript import.
Addon Configuration (Object with Options)
module.exports = { addons: [ { name: "storybook-addon-turbo-build", options: { optimizationLevel: 2 } } ] };
import turboBuild from 'storybook-addon-turbo-build'; // then use turboBuild in webpack config
Configuration with options is done via an object in `.storybook/main.js`. Options allow customizing optimizations like `optimizationLevel` or `esbuildMinifyOptions`.

This quickstart demonstrates how to install and configure `storybook-addon-turbo-build` in `.storybook/main.js` for a Storybook v6 project, including an example of custom options and a basic React story to illustrate context.

/* .storybook/main.js */ module.exports = { stories: [ "../stories/**/*.stories.mdx", "../stories/**/*.stories.@(js|jsx|ts|tsx)", ], addons: [ "@storybook/addon-links", "@storybook/addon-essentials", { name: "storybook-addon-turbo-build", options: { optimizationLevel: 2, // Example: Increase optimization level esbuildMinifyOptions: { // Example: Customize esbuild minification target: "es2017", minifyWhitespace: true } }, }, ], }; /* stories/Button.stories.jsx (example story) */ import React from 'react'; const Button = ({ children, onClick }) => ( <button type="button" onClick={onClick}> {children} </button> ); export default { title: 'Example/Button', component: Button, }; const Template = (args) => <Button {...args} />; export const Primary = Template.bind({}); Primary.args = { children: 'Primary Button', onClick: () => console.log('Button clicked!') };
Debug
Known issues
breakingThe `esbuildMinifyOptions.sourcemap` option was removed in version 2.0.0 due to an upgrade of `esbuild-loader` to v3. Using this option in v2.0.0 or later will lead to configuration errors.
fix
Remove `sourcemap` from your `esbuildMinifyOptions` configuration. Source map handling is now managed differently by `esbuild-loader`.
affects: >=2.0.0
breakingThis addon is explicitly incompatible with Storybook v7 and later versions. Storybook v7 and subsequent releases have integrated significant build performance improvements (e.g., Vite/webpack 5 integration) that supersede the functionality of this addon.
fix
Do not install or use `storybook-addon-turbo-build` with Storybook v7 or newer. Rely on Storybook's native performance enhancements. If using Storybook v6, ensure this addon is properly configured for that version.
affects: >=1.0.0 (when used with Storybook v7+)
gotchaThe performance benefits of `storybook-addon-turbo-build` are primarily observed during 'cold builds' (without cache). For builds with an existing `node_modules/.cache`, the performance difference might be barely noticeable. It is recommended to evaluate build times before and after integration to assess its real-world impact on your specific project.
fix
Measure your Storybook build times (cold vs. warm) before and after integrating the addon using tools like `webpack-bundle-analyzer` or simple `time` commands to confirm its effectiveness for your workflow.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Addon storybook-addon-turbo-build is not installed or cannot be resolved. Make sure you've installed it.
The package `storybook-addon-turbo-build` has not been installed as a dev dependency in your project.
fix
Run `npm install -D storybook-addon-turbo-build` or `yarn add -D storybook-addon-turbo-build` to install the addon.
TypeError: Cannot read properties of undefined (reading 'sourcemap') OR 'sourcemap' is not a valid esbuildMinifyOption
Attempting to use the `sourcemap` option within `esbuildMinifyOptions` in `storybook-addon-turbo-build` version 2.0.0 or higher, where it has been removed.
fix
Remove the `sourcemap` key from your `esbuildMinifyOptions` object in `.storybook/main.js`. For example, change `{ target: 'es2015', sourcemap: false }` to `{ target: 'es2015' }`.
Storybook build fails with errors related to Webpack configuration or 'esbuild-loader' on Storybook v7+
Using `storybook-addon-turbo-build` with Storybook v7 or a newer version, which is explicitly unsupported and causes compatibility issues with Storybook's updated build systems.
fix
Remove `storybook-addon-turbo-build` from your `.storybook/main.js` configuration and uninstall the package. Storybook v7+ has native performance improvements that make this addon redundant and problematic.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
Bingbot
1
Resources
storybook-addon-turbo-build — npm install storybook-addon-turbo-build · libregistry