From 39e4619f45013ff3873e32040e7b693392985390 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Thu, 14 May 2020 16:33:17 -0400 Subject: [PATCH] Setting CleanWebpackPlugin's cleanStaleWebpackAssets: false There is currently a bug where, on a "watch" rebuild, sometimes an image that's referenced from a CSS file won't be "noticed" and will be mistakenly deleted. --- lib/plugins/clean.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/plugins/clean.js b/lib/plugins/clean.js index 154b19ae..d114788e 100644 --- a/lib/plugins/clean.js +++ b/lib/plugins/clean.js @@ -29,7 +29,9 @@ module.exports = function(plugins, webpackConfig) { const cleanWebpackPluginOptions = { verbose: false, - cleanOnceBeforeBuildPatterns: webpackConfig.cleanWebpackPluginPaths + cleanOnceBeforeBuildPatterns: webpackConfig.cleanWebpackPluginPaths, + // disabled to avoid a bug where some files were incorrectly deleted on watch rebuild + cleanStaleWebpackAssets: false }; plugins.push({