CLI: Add --build-only
option to start-storybook
(useful to warm up the cache)
#13798
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issues:
Related to Discussion #13737 (where I initially described the use-case)
Related to #13266
Related to #13789
Related to #13784
I’d like a deterministic way to warm up a reusable cache for
start-storybook
without needing to start the server (nor opening the browser), which ideally would ensure that the next time somebody runsstart-storybook
, the cache is picked up and it runs faster.For example, in the proprietary equivalent to GitHub Codespaces we run internally at Shopify, a warm cache means reducing Storybook's boot time by 30s (from 1m to 30s).
This is close to
--ci
but without the server. It's also close to--smoke-test
, but without outputting stats, and with properly working caches.What I did
I added a new CLI option that intends to run everything a standard
start-storybook
would, but doesn't start the server.How to test
Assuming
yarn bootstrap
ran successfully,cd examples/cra-ts-examples
rm -rf node_modules/.cache/storybook
yarn start-storybook --build-only
: should exit without opening a browseryarn start-storybook
: should run faster