Skip to content

Commit 8996b23

Browse files
committed
Downgrade clean-webpack-plugin
1 parent 531e7da commit 8996b23

File tree

3 files changed

+371
-665
lines changed

3 files changed

+371
-665
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"babel-loader": "8.1.0",
3939
"browser-sync": "2.26.13",
4040
"browser-sync-webpack-plugin": "2.2.2",
41-
"clean-webpack-plugin": "3.0.0",
41+
"clean-webpack-plugin": "1.0.1",
4242
"create-pwa": "2.3.0",
4343
"critical": "2.0.6",
4444
"css-loader": "5.0.0",

webpack.config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const { ProvidePlugin } = require('webpack');
1010
const SpritesmithPlugin = require('webpack-spritesmith');
1111
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
1212
const WebpackShellPlugin = require('webpack-shell-plugin');
13+
const CleanWebpackPlugin = require('clean-webpack-plugin');
1314
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
14-
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
1515

1616
const { url, server, NODE_ENV } = argv;
1717
const sourceMap = {
@@ -131,7 +131,9 @@ const spritesmithConfig = {
131131
};
132132

133133
const cleanConfig = {
134-
cleanOnceBeforeBuildPatterns: ['dist/*', '!dist/sprite.svg']
134+
verbose: false,
135+
exclude: ['sprite.svg'],
136+
allowExternal: true
135137
};
136138

137139
const shellScripts = [];
@@ -219,7 +221,7 @@ module.exports = () => {
219221
}),
220222
new MiniCssExtractPlugin(extractTextConfig),
221223
new SpritesmithPlugin(spritesmithConfig),
222-
new CleanWebpackPlugin(cleanConfig),
224+
new CleanWebpackPlugin(['../assets/dist/'], cleanConfig),
223225
new WebpackShellPlugin({
224226
onBuildStart: shellScripts
225227
})

0 commit comments

Comments
 (0)