@@ -10,7 +10,6 @@ const { AureliaPlugin } = require('aurelia-webpack-plugin');
1010const { ProvidePlugin } = require ( 'webpack' ) ;
1111// @endif
1212const { BundleAnalyzerPlugin } = require ( 'webpack-bundle-analyzer' ) ;
13- const { CleanWebpackPlugin } = require ( 'clean-webpack-plugin' ) ;
1413
1514// config helpers:
1615const ensureArray = ( config ) => config && ( Array . isArray ( config ) ? config : [ config ] ) || [ ] ;
@@ -85,6 +84,7 @@ module.exports = ({ production }, { analyze, hmr, port, host }) => ({
8584 } ,
8685 mode : production ? 'production' : 'development' ,
8786 output : {
87+ clean : true ,
8888 path : outDir ,
8989 publicPath : baseUrl ,
9090 filename : production ? '[name].[chunkhash].bundle.js' : '[name].[fullhash].bundle.js' ,
@@ -349,13 +349,6 @@ module.exports = ({ production }, { analyze, hmr, port, host }) => ({
349349 { from : 'static' , to : outDir , globOptions : { ignore : [ '.*' ] } }
350350 ]
351351 } ) , // 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 ( ) )
360353 ]
361354} ) ;
0 commit comments