@@ -8,31 +8,6 @@ const path = require('path');
8
8
9
9
global . ReactiumWebpack = ReactiumWebpack ;
10
10
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
-
36
11
let artifacts = { } ;
37
12
class WebpackReactiumWebpack {
38
13
constructor ( name , ddd , context ) {
@@ -285,30 +260,11 @@ class WebpackReactiumWebpack {
285
260
return this . plugins . list . map ( ( { id, plugin } ) => plugin ) ;
286
261
}
287
262
288
- matchChunk ( test , debug ) {
263
+ matchChunk ( test ) {
289
264
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 ) ;
312
268
} ;
313
269
}
314
270
@@ -355,6 +311,7 @@ class WebpackReactiumWebpack {
355
311
setCodeSplittingOptimize ( env ) {
356
312
this . optimizationValue = {
357
313
minimize : Boolean ( env !== 'development' ) ,
314
+ chunkIds : 'named' ,
358
315
splitChunks : {
359
316
chunks : 'all' ,
360
317
cacheGroups : {
@@ -414,7 +371,6 @@ class WebpackReactiumWebpack {
414
371
target : this . target ,
415
372
output : this . output ,
416
373
entry : this . entry ,
417
- devtool : this . devtool ,
418
374
optimization : this . optimization ,
419
375
externals : this . getExternals ( ) ,
420
376
module : {
@@ -426,6 +382,8 @@ class WebpackReactiumWebpack {
426
382
...this . overrides ,
427
383
} ;
428
384
385
+ if ( this . devtool ) theConfig . devtool = this . devtool ;
386
+
429
387
if ( this . resolveAliases . list . length > 0 ) {
430
388
const alias = { } ;
431
389
this . resolveAliases . list . forEach ( ( { id : from , alias : to } ) => {
0 commit comments