@@ -8,31 +8,6 @@ const path = require('path');
88
99global . ReactiumWebpack = ReactiumWebpack ;
1010
11- const matchChunk = ( test , debug ) => module => {
12- const chunkNames = [ ] ;
13- for ( const chunk of module . chunksIterable ) {
14- chunkNames . push ( chunk . name ) ;
15- }
16-
17- const names = _ . compact (
18- _ . flatten ( [
19- module . nameForCondition && module . nameForCondition ( ) ,
20- chunkNames ,
21- ] ) ,
22- ) ;
23-
24- const match = ! ! names . find ( name => test . test ( name ) ) ;
25- if ( debug && match ) {
26- console . log ( {
27- test : test . toString ( ) ,
28- name : module . nameForCondition && module . nameForCondition ( ) ,
29- chunkNames,
30- } ) ;
31- }
32-
33- return match ;
34- } ;
35-
3611let artifacts = { } ;
3712class WebpackReactiumWebpack {
3813 constructor ( name , ddd , context ) {
@@ -285,30 +260,11 @@ class WebpackReactiumWebpack {
285260 return this . plugins . list . map ( ( { id, plugin } ) => plugin ) ;
286261 }
287262
288- matchChunk ( test , debug ) {
263+ matchChunk ( test ) {
289264 return module => {
290- const chunkNames = [ ] ;
291- for ( const chunk of module . chunksIterable ) {
292- chunkNames . push ( chunk . name ) ;
293- }
294-
295- const names = _ . compact (
296- _ . flatten ( [
297- module . nameForCondition && module . nameForCondition ( ) ,
298- chunkNames ,
299- ] ) ,
300- ) ;
301-
302- const match = ! ! names . find ( name => test . test ( name ) ) ;
303- if ( debug && match ) {
304- console . log ( {
305- test : test . toString ( ) ,
306- name : module . nameForCondition && module . nameForCondition ( ) ,
307- chunkNames,
308- } ) ;
309- }
310-
311- return match ;
265+ const moduleName =
266+ module . nameForCondition && module . nameForCondition ( ) ;
267+ return test . test ( moduleName ) ;
312268 } ;
313269 }
314270
@@ -355,6 +311,7 @@ class WebpackReactiumWebpack {
355311 setCodeSplittingOptimize ( env ) {
356312 this . optimizationValue = {
357313 minimize : Boolean ( env !== 'development' ) ,
314+ chunkIds : 'named' ,
358315 splitChunks : {
359316 chunks : 'all' ,
360317 cacheGroups : {
@@ -414,7 +371,6 @@ class WebpackReactiumWebpack {
414371 target : this . target ,
415372 output : this . output ,
416373 entry : this . entry ,
417- devtool : this . devtool ,
418374 optimization : this . optimization ,
419375 externals : this . getExternals ( ) ,
420376 module : {
@@ -426,6 +382,8 @@ class WebpackReactiumWebpack {
426382 ...this . overrides ,
427383 } ;
428384
385+ if ( this . devtool ) theConfig . devtool = this . devtool ;
386+
429387 if ( this . resolveAliases . list . length > 0 ) {
430388 const alias = { } ;
431389 this . resolveAliases . list . forEach ( ( { id : from , alias : to } ) => {
0 commit comments