From b566a0dad54882fdbe0c9dc601154a1d8c405139 Mon Sep 17 00:00:00 2001 From: Chunpeng Huo Date: Thu, 19 Dec 2024 13:01:47 +1000 Subject: [PATCH] chore: remove clean-webpack-plugin --- dotnet-core/package.json__if_webpack | 5 ----- webpack/package.json | 1 - webpack/webpack.config.js | 11 ++--------- 3 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 dotnet-core/package.json__if_webpack diff --git a/dotnet-core/package.json__if_webpack b/dotnet-core/package.json__if_webpack deleted file mode 100644 index 4eb7a78..0000000 --- a/dotnet-core/package.json__if_webpack +++ /dev/null @@ -1,5 +0,0 @@ -{ - "devDependencies": { - "clean-webpack-plugin": "^3.0.0" - } -} diff --git a/webpack/package.json b/webpack/package.json index 8cfedfc..eb5d8ba 100644 --- a/webpack/package.json +++ b/webpack/package.json @@ -41,7 +41,6 @@ "mini-css-extract-plugin": "^2.9.2", "aurelia-webpack-plugin": "^5.0.6", "duplicate-package-checker-webpack-plugin": "^3.0.0", - "clean-webpack-plugin": "^4.0.0", "webpack": "^5.97.1", "webpack-cli": "^5.1.4", "webpack-dev-server": "^5.2.0", diff --git a/webpack/webpack.config.js b/webpack/webpack.config.js index 44b749e..83cb826 100644 --- a/webpack/webpack.config.js +++ b/webpack/webpack.config.js @@ -10,7 +10,6 @@ const { AureliaPlugin } = require('aurelia-webpack-plugin'); const { ProvidePlugin } = require('webpack'); // @endif const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); -const { CleanWebpackPlugin } = require('clean-webpack-plugin'); // config helpers: const ensureArray = (config) => config && (Array.isArray(config) ? config : [config]) || []; @@ -85,6 +84,7 @@ module.exports = ({ production }, { analyze, hmr, port, host }) => ({ }, mode: production ? 'production' : 'development', output: { + clean: true, path: outDir, publicPath: baseUrl, filename: production ? '[name].[chunkhash].bundle.js' : '[name].[fullhash].bundle.js', @@ -349,13 +349,6 @@ module.exports = ({ production }, { analyze, hmr, port, host }) => ({ { from: 'static', to: outDir, globOptions: { ignore: ['.*'] } } ] }), // ignore dot (hidden) files - ...when(analyze, new BundleAnalyzerPlugin()), - /** - * Note that the usage of following plugin cleans the webpack output directory before build. - * In case you want to generate any file in the output path as a part of pre-build step, this plugin will likely - * remove those before the webpack build. In that case consider disabling the plugin, and instead use something like - * `del` (https://www.npmjs.com/package/del), or `rimraf` (https://www.npmjs.com/package/rimraf). - */ - new CleanWebpackPlugin() + ...when(analyze, new BundleAnalyzerPlugin()) ] });