@@ -48,7 +48,6 @@ export class Kaba
48
48
private publicPath : string = "/assets/app/js/" ;
49
49
private externals : Externals = { } ;
50
50
private moduleConcatenationEnabled : boolean = false ;
51
- private plugins : webpack . Plugin [ ] = [ ] ;
52
51
private javaScriptDependenciesFileName : string = "_dependencies" ;
53
52
private hashFileNames : boolean = true ;
54
53
private buildModern : boolean = true ;
@@ -62,23 +61,6 @@ export class Kaba
62
61
{
63
62
this . cwd = process . cwd ( ) ;
64
63
this . libRoot = path . dirname ( __dirname ) ;
65
- this . plugins = [
66
- new ProgressBarPlugin ( {
67
- complete : green ( "─" ) ,
68
- incomplete : gray ( "─" ) ,
69
- width : 50 ,
70
- format : ` ${ cyan ( "build" ) } :bar ${ green ( ":percent" ) } ${ gray ( ":msg" ) } ` ,
71
- } ) ,
72
- new DuplicatePackageCheckerPlugin ( {
73
- emitError : true ,
74
- strict : true ,
75
- } ) ,
76
- new ProvidePlugin ( {
77
- h : [ "preact" , "h" ] ,
78
- Fragment : [ "preact" , "Fragment" ] ,
79
- } ) ,
80
- new CleanWebpackPlugin ( ) ,
81
- ] ;
82
64
83
65
// set defaults
84
66
this . setOutputPath ( "build" ) ;
@@ -435,7 +417,29 @@ export class Kaba
435
417
} ,
436
418
437
419
// plugins
438
- plugins : this . plugins ,
420
+ plugins : [
421
+ new ProgressBarPlugin ( {
422
+ complete : green ( "─" ) ,
423
+ incomplete : gray ( "─" ) ,
424
+ width : 50 ,
425
+ format : ` ${ cyan ( "build" ) } :bar ${ green ( ":percent" ) } ${ gray ( ":msg" ) } ` ,
426
+ } ) ,
427
+ new DuplicatePackageCheckerPlugin ( {
428
+ emitError : true ,
429
+ strict : true ,
430
+ } ) ,
431
+ new ProvidePlugin ( {
432
+ h : [ "preact" , "h" ] ,
433
+ Fragment : [ "preact" , "Fragment" ] ,
434
+ } ) ,
435
+ new CleanWebpackPlugin ( ) ,
436
+ new DefinePlugin ( {
437
+ 'process.env.MODERN_BUILD' : isModule ,
438
+ 'MODERN_BUILD' : isModule ,
439
+ 'process.env.DEBUG' : cliConfig . debug ,
440
+ 'DEBUG' : cliConfig . debug ,
441
+ } ) ,
442
+ ] ,
439
443
440
444
// watch
441
445
watch : cliConfig . watch ,
@@ -446,15 +450,6 @@ export class Kaba
446
450
node : this . nodeSettings ,
447
451
} as Partial < webpack . Configuration > ;
448
452
449
- ( configTemplate . plugins as webpack . Plugin [ ] ) . push (
450
- new DefinePlugin ( {
451
- 'process.env.MODERN_BUILD' : isModule ,
452
- 'MODERN_BUILD' : isModule ,
453
- 'process.env.DEBUG' : cliConfig . debug ,
454
- 'DEBUG' : cliConfig . debug ,
455
- } )
456
- ) ;
457
-
458
453
if ( ! cliConfig . debug )
459
454
{
460
455
( configTemplate . optimization as any ) . minimizer . push ( new TerserPlugin ( {
0 commit comments