@@ -44,47 +44,45 @@ module.exports = {
44
44
minChunks : 2 ,
45
45
cacheGroups : {
46
46
automaticNamePrefix : 'chunk' ,
47
- components : {
48
- test : / [ \\ / ] c o m p o n e n t s [ \\ / ] / ,
49
- name : 'components' ,
50
- priority : 14 ,
51
- reuseExistingChunk : true ,
52
- minChunks : process . env . NODE_ENV === 'production' ? 1 : 2 ,
53
- chunks : 'initial' ,
54
- } ,
55
47
mix1 : {
48
+ test : ( module , chunks ) => {
49
+ return (
50
+ module . resource &&
51
+ ( module . resource . includes ( 'components' ) ||
52
+ / \/ n o d e _ m o d u l e s \/ r e a c t - b o o t s t r a p \/ / . test ( module . resource ) )
53
+ ) ;
54
+ } ,
56
55
name : 'chunk-mix1' ,
57
- test : / [ \/ ] n o d e _ m o d u l e s [ \/ ] ( i 1 8 n e x t | l o d a s h | m a r k e d | n e x t - s h a r e ) [ \/ ] / ,
58
56
filename : 'static/js/[name].[contenthash:8].chunk.js' ,
59
- priority : 12 ,
57
+ priority : 14 ,
60
58
reuseExistingChunk : true ,
61
- minChunks : 1 ,
59
+ minChunks : process . env . NODE_ENV === 'production' ? 1 : 2 ,
62
60
chunks : 'initial' ,
63
61
} ,
64
62
mix2 : {
65
63
name : 'chunk-mix2' ,
66
- test : / [ \/ ] n o d e _ m o d u l e s [ \/ ] ( @ r e m i x - r u n | @ r e s t a r t | a x i o s | d i f f ) [ \/ ] / ,
64
+ test : / [ \/ ] n o d e _ m o d u l e s [ \/ ] ( i 1 8 n e x t | l o d a s h | m a r k e d | n e x t - s h a r e ) [ \/ ] / ,
67
65
filename : 'static/js/[name].[contenthash:8].chunk.js' ,
68
- priority : 11 ,
66
+ priority : 13 ,
69
67
reuseExistingChunk : true ,
70
68
minChunks : 1 ,
71
69
chunks : 'initial' ,
72
70
} ,
73
- reactBootstrap : {
74
- name : 'react-bootstrap ' ,
75
- test : / [ \/ ] n o d e _ m o d u l e s [ \/ ] ( r e a c t - b o o t s t r a p ) [ \/ ] / ,
71
+ mix3 : {
72
+ name : 'chunk-mix3 ' ,
73
+ test : / [ \/ ] n o d e _ m o d u l e s [ \/ ] ( @ r e m i x - r u n | @ r e s t a r t | a x i o s | d i f f ) [ \/ ] / ,
76
74
filename : 'static/js/[name].[contenthash:8].chunk.js' ,
77
- priority : 11 ,
75
+ priority : 12 ,
76
+ reuseExistingChunk : true ,
78
77
minChunks : 1 ,
79
78
chunks : 'initial' ,
80
- reuseExistingChunk : true ,
81
79
} ,
82
80
codemirror : {
83
81
name : 'codemirror' ,
84
82
test : / [ \/ ] n o d e _ m o d u l e s [ \/ ] ( \@ c o d e m i r r o r ) [ \/ ] / ,
85
- priority : 9 ,
83
+ priority : 10 ,
86
84
reuseExistingChunk : true ,
87
- minChunks : 1 ,
85
+ minChunks : process . env . NODE_ENV === 'production' ? 1 : 2 ,
88
86
chunks : 'initial' ,
89
87
enforce : true ,
90
88
} ,
@@ -93,15 +91,15 @@ module.exports = {
93
91
test : / [ \/ ] n o d e _ m o d u l e s [ \/ ] ( \@ l e z e r ) [ \/ ] / ,
94
92
priority : 9 ,
95
93
reuseExistingChunk : true ,
96
- minChunks : 1 ,
94
+ minChunks : process . env . NODE_ENV === 'production' ? 1 : 2 ,
97
95
chunks : 'initial' ,
98
96
enforce : true ,
99
97
} ,
100
98
reactDom : {
101
99
name : 'react-dom' ,
102
100
test : / [ \/ ] n o d e _ m o d u l e s [ \/ ] ( r e a c t - d o m ) [ \/ ] / ,
103
101
filename : 'static/js/[name].[contenthash:8].chunk.js' ,
104
- priority : 7 ,
102
+ priority : 8 ,
105
103
reuseExistingChunk : true ,
106
104
chunks : 'all' ,
107
105
enforce : true ,
0 commit comments