title |
---|
CLI options |
The Storybook command line interface (CLI) is the main tool you use to build and develop Storybook.
Storybook collects completely anonymous data to help us improve user experience. Participation is optional, and you may opt-out if you'd not like to share any information.
All of the following documentation is available in the CLI by running storybook --help
.
Compiles and serves a development build of your Storybook that reflects your source code changes in the browser in real time. Should be run from the root of your project.
storybook dev [options]
Options include:
Option | Description |
---|---|
--help |
Output usage information storybook dev --help |
-V , --version |
Output the version number storybook dev -V |
-p , --port [number] |
Port to run Storybook storybook dev -p 9009 |
-h , --host [string] |
Host to run Storybook storybook dev -h my-host.com |
-s , --static-dir |
Deprecated see note. Directory where to load static files from, comma-separated liststorybook dev -s public |
-c , --config-dir [dir-name] |
Directory where to load Storybook configurations from storybook dev -c .storybook |
--https |
Serve Storybook over HTTPS. Note: You must provide your own certificate informationstorybook dev --https |
--ssl-ca |
Provide an SSL certificate authority. (Optional with --https, required if using a self-signed certificate)storybook dev --ssl-ca my-certificate |
--ssl-cert |
Provide an SSL certificate. (Required with --https)storybook dev --ssl-cert my-ssl-certificate |
--ssl-key |
Provide an SSL key. (Required with --https)storybook dev --ssl-key my-ssl-key |
--smoke-test |
Exit after successful startstorybook dev --smoke-test |
--ci |
CI mode (skip interactive prompts, don't open browser)storybook dev --ci |
--no-open |
Do not open Storybook automatically in the browserstorybook dev --no-open |
--quiet |
Suppress verbose build outputstorybook dev --quiet |
--debug-webpack |
Display final webpack configurations for debugging purposesstorybook dev --debug-webpack |
--webpack-stats-json |
Write Webpack Stats JSON to diskstorybook dev --webpack-stats-json /tmp/webpack-stats |
--docs |
Starts Storybook in documentation mode. Learn more about it in herestorybook dev --docs |
--disable-telemetry |
Disables Storybook's telemetry. Learn more about it herestorybook dev --disable-telemetry |
💡 Starting in 6.4 the -s
flag is deprecated. Instead, use a configuration object in your .storybook/main.js
file. See the images and assets documentation for more information.
Compiles your Storybook instance so it can be deployed. Should be run from the root of your project.
storybook build [options]
Options include:
Option | Description |
---|---|
-h , --help |
Output usage informationstorybook build --help |
-V , --version |
Output the version numberstorybook build -V |
-s , --static-dir |
Deprecated see note. Directory where to load static files from, comma-separated list storybook build -s public |
-o , --output-dir [dir-name] |
Directory where to store built filesstorybook build -o /my-deployed-storybook |
-c , --config-dir [dir-name] |
Directory where to load Storybook configurations fromstorybook build -c .storybook |
--loglevel [level] |
Controls level of logging during build. Available options: silly , verbose , info (default), warn , error , silent storybook build --loglevel warn |
--quiet |
Suppress verbose build outputstorybook build --quiet |
--debug-webpack |
Display final webpack configurations for debugging purposesstorybook build --debug-webpack |
--webpack-stats-json |
Write Webpack Stats JSON to diskstorybook build --webpack-stats-json /my-storybook/webpack-stats |
--docs |
Builds Storybook in documentation mode. Learn more about it in herestorybook build --docs |
--disable-telemetry |
Disables Storybook's telemetry. Learn more about it here.storybook build --disable-telemetry |
npm run storybook build -- -o ./path/to/build
.