From 86c52028978d6492524398b779b7a0920b13c8e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Bourgoin?= Date: Mon, 16 Dec 2019 12:55:54 +0100 Subject: [PATCH] Update webpack configuration for clean-webpack plugin v3 --- webpack.common.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webpack.common.js b/webpack.common.js index 568c15e..61e2d62 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -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', @@ -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: {