Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Add option to force-build iframe despite custom preview URL #15030

Merged
merged 1 commit into from
May 25, 2021

Conversation

shilman
Copy link
Member

@shilman shilman commented May 25, 2021

Issue: #14591

What I did

Added a new CLI option, --force-build-preview that forces start/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

yarn build-storybook --preview-url=http://localhost:5000 --force-build-preview
# Observe iframe.html has been generated

@nx-cloud
Copy link

nx-cloud bot commented May 25, 2021

Nx Cloud Report

CI ran the following commands for commit 8a77cf7. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=prepare --all --parallel --max-parallel=15

Sent with 💌 from NxCloud.

@shilman shilman changed the title Core: Add option to build iframe even when preview URL is specified Core: Add option to force-build iframe when preview URL is specified May 25, 2021
@shilman shilman changed the title Core: Add option to force-build iframe when preview URL is specified Core: Add option to force-build iframe despite custom preview URL May 25, 2021
@shilman shilman added cli and removed core labels May 25, 2021
@shilman shilman changed the title Core: Add option to force-build iframe despite custom preview URL CLI: Add option to force-build iframe despite custom preview URL May 25, 2021
@shilman shilman merged commit c473494 into next May 25, 2021
@shilman shilman deleted the 14591-build-iframe-with-preview-url branch May 25, 2021 16:28
@bigbald726
Copy link

After 2 hours roaming on the Internet Finally I found the permanent solution to my problem !!!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants