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

Clear build folder in static build #6024

Merged
merged 1 commit into from
Mar 16, 2019
Merged

Conversation

CurtisHumphrey
Copy link
Contributor

Issue:

The static site building did not completely clear the build folder. This causes issues with additional plugins like CopyWebpackPlugin because once a file was added it was never removed.

What I did

Changed the logic to completely clear the output dir and cleaned up so that it only copies the defaultFavIcon once.

How to test

  1. Build using build-storybook.
  2. Put a file into the root folder like test.html.
  3. Now on future build file will be removed

It should clear the output folder completely and then only copy the defaultFavIcon once.  This allows the use of plugins like CopyWebpackPlugin to work as expected (otherwise what it copies is never removed on future builds).
@shilman shilman added bug cli patch:yes Bugfix & documentation PR that need to be picked to main branch labels Mar 11, 2019
@shilman shilman added this to the 5.0.x milestone Mar 11, 2019
@shilman
Copy link
Member

shilman commented Mar 11, 2019

@ndelangen pls review .. seems like a big change & i'm not sure why the old code was that way

Copy link
Member

@wuweiweiwu wuweiweiwu left a comment

Choose a reason for hiding this comment

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

LGTM to me. seems to set up the directories correctly

@shilman shilman merged commit 5a9f96e into storybookjs:next Mar 16, 2019
@shilman shilman changed the title Update build-static.js Clear build folder in build-static Mar 16, 2019
@shilman shilman changed the title Clear build folder in build-static Clear build folder in static build Mar 16, 2019
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Mar 17, 2019
shilman added a commit that referenced this pull request Mar 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cli patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants