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

fix: do not clean directory if webpack errors are present during initial build #134

Merged
merged 1 commit into from May 22, 2019

Conversation

chrisblossom
Copy link
Collaborator

Please hold off on merging this.

Although this is a fix for #133, is it also a breaking change? I think it could be if someone is using a webpack plugin that manually creates files inside webpack's output.path after the compile hook, although this is not supported by webpack and probably can/should be ignored. Thoughts?

@codecov-io
Copy link

codecov-io commented May 2, 2019

Codecov Report

Merging #134 into master will increase coverage by 0.09%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #134      +/-   ##
=========================================
+ Coverage   98.71%   98.8%   +0.09%     
=========================================
  Files           1       1              
  Lines          78      84       +6     
  Branches       27      28       +1     
=========================================
+ Hits           77      83       +6     
  Misses          1       1
Impacted Files Coverage Δ
src/clean-webpack-plugin.ts 98.8% <100%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 336dbcb...fce56a8. Read the comment docs.

@thomastay
Copy link

Hi @chrisblossom @johnagan this PR broke our build :(, would appreciate feedback on how to upgrade to the new version.
We currently have two Webpack configs which emit different files into our shared dist/ folder. Since Webpack runs the configs in parallel, there can be a problem where one config cleans the other's emitted files.

With this change, whichever config finishes compiling second will clean up the other config's emitted files. Previously, since we cleaned before compiling, this didn't happen because both the cleans happened immediately, before any files were compiled. (technically, it was a race condition back then, but our compiles are long enough that it never surfaced)

Is there a way to only clean the files that would be emitted by webpack? Or any other thoughts?

Versions:
Webpack 4.44

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

Successfully merging this pull request may close these issues.

None yet

4 participants