File tree 2 files changed +17
-5
lines changed
2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 67
67
"zone.js" : " ^0.8.26"
68
68
},
69
69
"devDependencies" : {
70
+ "@angular-devkit/build-angular" : " ~0.6.6" ,
70
71
"@angular/cli" : " ^6.0.5" ,
71
72
"@angular/compiler-cli" : " 6.0.3" ,
72
73
"@ngtools/webpack" : " ^6.0.5" ,
86
87
"karma-remap-coverage" : " ^0.1.5" ,
87
88
"karma-sourcemap-loader" : " ^0.3.7" ,
88
89
"karma-webpack" : " ^2.0.4" ,
89
- "mini-css-extract-plugin" : " 0.4.0" ,
90
+ "mini-css-extract-plugin" : " ^ 0.4.0" ,
90
91
"tslint" : " ^5.10.0" ,
91
92
"uglifyjs-webpack-plugin" : " ^1.2.5" ,
92
93
"webpack-bundle-analyzer" : " ^2.13.1" ,
93
- "webpack-cli" : " ^2.1.4" ,
94
- "@angular-devkit/build-angular" : " ~0.6.6"
94
+ "webpack-cli" : " ^2.1.4"
95
95
}
96
96
}
Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ const allModules = treeShakableModules.concat(nonTreeShakableModules);
30
30
31
31
module . exports = ( env ) => {
32
32
console . log ( `env = ${ JSON . stringify ( env ) } ` )
33
+ const extractCSS = new MiniCssExtractPlugin ( {
34
+ // Options similar to the same options in webpackOptions.output
35
+ // both options are optional
36
+ filename : "[name].css" ,
37
+ chunkFilename : "[id].css"
38
+ } ) ;
33
39
const isDevBuild = ! ( env && env . prod ) ;
34
40
const sharedConfig = {
35
41
mode : isDevBuild ? "development" : "production" ,
@@ -70,7 +76,10 @@ module.exports = (env) => {
70
76
module : {
71
77
rules : [ {
72
78
test : / \. c s s ( \? | $ ) / ,
73
- use : [ 'style-loader' , MiniCssExtractPlugin . loader , isDevBuild ? 'css-loader' : 'css-loader?minimize' ]
79
+ use : [
80
+ MiniCssExtractPlugin . loader ,
81
+ isDevBuild ? 'css-loader' : 'css-loader?minimize'
82
+ ]
74
83
} ]
75
84
} ,
76
85
plugins : [
@@ -118,7 +127,10 @@ module.exports = (env) => {
118
127
module : {
119
128
rules : [ {
120
129
test : / \. c s s ( \? | $ ) / ,
121
- use : [ 'to-string-loader' , isDevBuild ? 'css-loader' : 'css-loader?minimize' ]
130
+ use : [
131
+ MiniCssExtractPlugin . loader ,
132
+ isDevBuild ? 'css-loader' : 'css-loader?minimize'
133
+ ]
122
134
} ]
123
135
} ,
124
136
plugins : [
You can’t perform that action at this time.
0 commit comments