@@ -52,6 +52,7 @@ export class Kaba
52
52
private javaScriptDependenciesFileName : string = "_dependencies" ;
53
53
private hashFileNames : boolean = true ;
54
54
private buildModern : boolean = true ;
55
+ private hasPerEntryCompilation : boolean = false ;
55
56
private nodeSettings : webpack . Node | false = false ;
56
57
57
58
@@ -226,6 +227,16 @@ export class Kaba
226
227
}
227
228
228
229
230
+ /**
231
+ * Disables the per entry file compilation.
232
+ */
233
+ public enablePerEntryCompilation ( ) : this
234
+ {
235
+ this . hasPerEntryCompilation = true ;
236
+ return this ;
237
+ }
238
+
239
+
229
240
/**
230
241
* Setting for polyfilling core node packages
231
242
*/
@@ -510,6 +521,36 @@ export class Kaba
510
521
] ,
511
522
} ;
512
523
524
+ if ( ! this . hasPerEntryCompilation ) {
525
+ let config = Object . assign ( { } , configTemplate , {
526
+ entry : {
527
+ entry : entries ,
528
+ } ,
529
+ } ) as Partial < webpack . Configuration > ;
530
+
531
+ if ( ! isModule && undefined !== config . module )
532
+ {
533
+ config . module . rules . push ( {
534
+ // ESLint
535
+ test : / \. m ? j s x ? $ / ,
536
+ // only lint files that are in the project dir & exclude tests, vendor and node_modules
537
+ include : ( path ) => path . startsWith ( this . cwd ) && ! / n o d e _ m o d u l e s | t e s t s | v e n d o r / . test ( path ) ,
538
+ loader : "eslint-loader" ,
539
+ options : {
540
+ cache : true ,
541
+ configFile : path . join ( this . libRoot , "configs/.eslintrc.yml" ) ,
542
+ fix : cliConfig . fix ,
543
+ parser : "babel-eslint" ,
544
+ quiet : ! cliConfig . lint ,
545
+ // always only emit a warning, so to actually never fail the webpack build
546
+ emitWarning : true ,
547
+ } ,
548
+ } )
549
+ }
550
+
551
+ return [ config ]
552
+ }
553
+
513
554
return Object . keys ( entries ) . map ( entryFile =>
514
555
{
515
556
let config = Object . assign ( { } , configTemplate , {
0 commit comments