CLI: Add option to force-build iframe despite custom preview URL #15030
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.
Issue: #14591
What I did
Added a new CLI option,
--force-build-preview
that forcesstart/build-storybook
to build the preview iframe even when--preview-url
is specified.Some background:
5.2(?) SB adds
--preview-url
so users can specify an externally-provided preview iframe. It contained a bug where it also built the preview iframe even though it shouldn't be needed.5.x Users discover they can use
--preview-url
to work around a bug in how Storybook handles static files, relying on the bug #3699 (comment)6.2 While refactoring the build process to support pluggable builders, we fix the bug introduced in 5.2, breaking the workaround. #14591
6.3 Not wanting to risk a breaking change in the webpack setup, we introduce a new feature to force the building of the preview URL. This is hopefully temporary and can be replaced with a solution to #3699 in 7.0.
cc @sarahbethfederman @manuelpuyol @KarlBao
How to test