@@ -45,41 +45,41 @@ export const createClientConfig = (
45
45
}
46
46
47
47
// optimizations for production mode
48
- if ( app . env . isProd ) {
49
- // extract-css
50
- config . plugin ( 'extract-css' ) . use ( require ( 'mini-css-extract-plugin' ) , [
51
- {
52
- filename : 'assets/css/styles.[chunkhash:8].css' ,
53
- } ,
54
- ] )
48
+ // extract-css
49
+ config . plugin ( 'extract-css' ) . use ( require ( 'mini-css-extract-plugin' ) , [
50
+ {
51
+ filename : app . env . isProd
52
+ ? 'assets/css/styles.[chunkhash:8].css'
53
+ : 'assets/css/styles.css' ,
54
+ } ,
55
+ ] )
55
56
56
- config . optimization . splitChunks ( {
57
- cacheGroups : {
58
- // ensure all css are extracted together.
59
- // since most of the CSS will be from the theme and very little
60
- // CSS will be from async chunks
61
- styles : {
62
- idHint : 'styles' ,
63
- // necessary to ensure async chunks are also extracted
64
- test : ( m ) => / c s s \/ m i n i - e x t r a c t / . test ( m . type ) ,
65
- chunks : 'all' ,
66
- enforce : true ,
67
- reuseExistingChunk : true ,
68
- } ,
69
- // extract external library to a standalone chunk
70
- vendor : {
71
- idHint : 'vendor' ,
72
- test : / n o d e _ m o d u l e s / ,
73
- chunks : 'all' ,
74
- priority : - 10 ,
75
- reuseExistingChunk : true ,
76
- } ,
57
+ config . optimization . splitChunks ( {
58
+ cacheGroups : {
59
+ // ensure all css are extracted together.
60
+ // since most of the CSS will be from the theme and very little
61
+ // CSS will be from async chunks
62
+ styles : {
63
+ idHint : 'styles' ,
64
+ // necessary to ensure async chunks are also extracted
65
+ test : ( m ) => / c s s \/ m i n i - e x t r a c t / . test ( m . type ) ,
66
+ chunks : 'all' ,
67
+ enforce : true ,
68
+ reuseExistingChunk : true ,
77
69
} ,
78
- } )
70
+ // extract external library to a standalone chunk
71
+ vendor : {
72
+ idHint : 'vendor' ,
73
+ test : / n o d e _ m o d u l e s / ,
74
+ chunks : 'all' ,
75
+ priority : - 10 ,
76
+ reuseExistingChunk : true ,
77
+ } ,
78
+ } ,
79
+ } )
79
80
80
- // enable runtimeChunk
81
- config . optimization . runtimeChunk ( true )
82
- }
81
+ // enable runtimeChunk
82
+ config . optimization . runtimeChunk ( true )
83
83
84
84
// disable performance hints
85
85
if ( ! app . env . isDebug ) {
0 commit comments