@@ -10,7 +10,6 @@ const { AureliaPlugin } = require('aurelia-webpack-plugin');
10
10
const { ProvidePlugin } = require ( 'webpack' ) ;
11
11
// @endif
12
12
const { BundleAnalyzerPlugin } = require ( 'webpack-bundle-analyzer' ) ;
13
- const { CleanWebpackPlugin } = require ( 'clean-webpack-plugin' ) ;
14
13
15
14
// config helpers:
16
15
const ensureArray = ( config ) => config && ( Array . isArray ( config ) ? config : [ config ] ) || [ ] ;
@@ -85,6 +84,7 @@ module.exports = ({ production }, { analyze, hmr, port, host }) => ({
85
84
} ,
86
85
mode : production ? 'production' : 'development' ,
87
86
output : {
87
+ clean : true ,
88
88
path : outDir ,
89
89
publicPath : baseUrl ,
90
90
filename : production ? '[name].[chunkhash].bundle.js' : '[name].[fullhash].bundle.js' ,
@@ -349,13 +349,6 @@ module.exports = ({ production }, { analyze, hmr, port, host }) => ({
349
349
{ from : 'static' , to : outDir , globOptions : { ignore : [ '.*' ] } }
350
350
]
351
351
} ) , // ignore dot (hidden) files
352
- ...when ( analyze , new BundleAnalyzerPlugin ( ) ) ,
353
- /**
354
- * Note that the usage of following plugin cleans the webpack output directory before build.
355
- * In case you want to generate any file in the output path as a part of pre-build step, this plugin will likely
356
- * remove those before the webpack build. In that case consider disabling the plugin, and instead use something like
357
- * `del` (https://www.npmjs.com/package/del), or `rimraf` (https://www.npmjs.com/package/rimraf).
358
- */
359
- new CleanWebpackPlugin ( )
352
+ ...when ( analyze , new BundleAnalyzerPlugin ( ) )
360
353
]
361
354
} ) ;
0 commit comments