webpack-encore icon indicating copy to clipboard operation
webpack-encore copied to clipboard

[RFC] Change cleanupOutputBeforeBuild() to use beforeEmit:true for later deleting

Open weaverryan opened this issue 6 years ago • 5 comments

The https://github.com/johnagan/clean-webpack-plugin has a beforeEmit option that default to false. When this is true, it deletes the files later - right before emit. This means that the time between when the files are deleted and recreated is much smaller.

I think we should change this to be the default behavior. For some deploys, deleting the old files at the beginning means that their production site is missing the files until the build finishes. Probably those deploy systems could be made better - but beforeEmit also seems like a better way to do things in general.

weaverryan avatar Dec 05 '18 15:12 weaverryan