File tree Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -344,17 +344,9 @@ class ConfigGenerator {
344
344
345
345
if ( this . webpackConfig . cleanupOutput ) {
346
346
plugins . push (
347
- new CleanWebpackPlugin ( [ this . webpackConfig . outputPath ] , {
347
+ new CleanWebpackPlugin ( [ '**/*' ] , {
348
+ root : this . webpackConfig . outputPath ,
348
349
verbose : false ,
349
- /*
350
- * Instead of passing the "root" option and then making
351
- * the first argument (this.webpackConfig.outputPath) relative
352
- * to that (e.g. "builds"), we pass the absolute path as
353
- * the first argument. To the plugin, this looks like a
354
- * path that is "outside of the project root". This flag
355
- * says to ignore that.
356
- */
357
- allowExternal : true
358
350
} )
359
351
) ;
360
352
}
Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ function emptyTmpDir() {
94
94
95
95
function touchFileInOutputDir ( filename , webpackConfig ) {
96
96
const fullPath = path . join ( webpackConfig . outputPath , filename ) ;
97
+ fs . ensureDirSync ( path . dirname ( fullPath ) ) ;
98
+
97
99
fs . writeFileSync (
98
100
fullPath ,
99
101
''
Original file line number Diff line number Diff line change @@ -554,12 +554,16 @@ module.exports = {
554
554
config . addEntry ( 'main' , './js/no_require' ) ;
555
555
config . cleanupOutputBeforeBuild ( ) ;
556
556
testSetup . touchFileInOutputDir ( 'file.txt' , config ) ;
557
+ testSetup . touchFileInOutputDir ( 'deeper/other.txt' , config ) ;
557
558
558
559
testSetup . runWebpack ( config , ( webpackAssert ) => {
559
560
// make sure the file was cleaned up!
560
561
webpackAssert . assertOutputFileDoesNotExist (
561
562
'file.txt'
562
563
) ;
564
+ webpackAssert . assertOutputFileDoesNotExist (
565
+ 'deeper/other.txt'
566
+ ) ;
563
567
564
568
done ( ) ;
565
569
} ) ;
You can’t perform that action at this time.
0 commit comments