Skip to content

Commit

Permalink
Update webpack configuration for clean-webpack plugin v3
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlatz committed Dec 16, 2019
1 parent 22d3b53 commit 86c5202
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');

const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');

module.exports = {
mode: 'development',
Expand Down Expand Up @@ -39,7 +39,9 @@ module.exports = {
]
},
plugins: [
new CleanWebpackPlugin(['dist'], { exclude: ['images', 'favicon.png'] }),
new CleanWebpackPlugin({
cleanOnceBeforeBuildPatterns: ['dist', '!dist/images']
}),
new HtmlWebpackPlugin({ template: 'public/index.html' }),
],
optimization: {
Expand Down

0 comments on commit 86c5202

Please sign in to comment.