Skip to content

CLI: Remove watch mode from the build-storybook documentation#16165

Merged
shilman merged 1 commit into
storybookjs:nextfrom
glocore:remove-watch-mode
Oct 4, 2021
Merged

CLI: Remove watch mode from the build-storybook documentation#16165
shilman merged 1 commit into
storybookjs:nextfrom
glocore:remove-watch-mode

Conversation

@glocore
Copy link
Copy Markdown
Contributor

@glocore glocore commented Sep 27, 2021

Issue: #15946

-w or --watch-mode flag doesn't do anything when running the build-storybook script.

What I did

  • Removed --watch-mode from commander so that it doesn't show up in the list of available options.
  • Removed watch mode from the docs.

How to test

Run yarn build-storybook -h. --watch-mode should no longer show up as an option.

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Sep 27, 2021

Nx Cloud Report

We didn't find any information for the current pull request with the commit 121d862.
You might need to set the 'NX_BRANCH' environment variable in your CI pipeline.

Check the Nx Cloud Github Integration documentation for more information.


Sent with 💌 from NxCloud.

@shilman shilman added cli maintenance User-facing maintenance tasks labels Sep 27, 2021
@shilman shilman added this to the 6.4 PRs milestone Sep 27, 2021
Copy link
Copy Markdown
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much @glocore !!! 🙏

There is some discussion in the issue about whether we should restore the watch-mode feature, but in the meantime it makes sense for the documentation to match the code, so I'm merging this.

@shilman shilman changed the title Removes watch mode from the build-storybook script CLI: Remove watch mode from the build-storybook documentation Oct 4, 2021
@shilman shilman merged commit 6b64da2 into storybookjs:next Oct 4, 2021
tysoncung added a commit to tysoncung/storybook that referenced this pull request Mar 18, 2026
Re-implement the --watch / -w flag for 'storybook build' that was
previously removed due to being broken.

Changes:
- Add -w/--watch CLI option to the build command
- Add 'watch' property to CLIOptions type
- Implement webpack watch mode using compiler.watch() instead of
  compiler.run() when --watch is passed
- Implement vite watch mode by setting build.watch option
- Handle rebuild logging and error recovery in watch mode
- Prevent premature process exit and 'build completed' message in
  watch mode

The watch flag was originally added via storybookjs#2762 but regressed at some
point when the build pipeline was refactored. The CLI option was
later removed entirely in storybookjs#16165 since it wasn't functional.

This restores the feature by properly wiring the watch option through
to both the webpack5 and vite builders.

Fixes storybookjs#15946
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli maintenance User-facing maintenance tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants