File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 6767 "zone.js" : " ^0.8.26"
6868 },
6969 "devDependencies" : {
70+ "@angular-devkit/build-angular" : " ~0.6.6" ,
7071 "@angular/cli" : " ^6.0.5" ,
7172 "@angular/compiler-cli" : " 6.0.3" ,
7273 "@ngtools/webpack" : " ^6.0.5" ,
8687 "karma-remap-coverage" : " ^0.1.5" ,
8788 "karma-sourcemap-loader" : " ^0.3.7" ,
8889 "karma-webpack" : " ^2.0.4" ,
89- "mini-css-extract-plugin" : " 0.4.0" ,
90+ "mini-css-extract-plugin" : " ^ 0.4.0" ,
9091 "tslint" : " ^5.10.0" ,
9192 "uglifyjs-webpack-plugin" : " ^1.2.5" ,
9293 "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"
9595 }
9696}
Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ const allModules = treeShakableModules.concat(nonTreeShakableModules);
3030
3131module . exports = ( env ) => {
3232 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+ } ) ;
3339 const isDevBuild = ! ( env && env . prod ) ;
3440 const sharedConfig = {
3541 mode : isDevBuild ? "development" : "production" ,
@@ -70,7 +76,10 @@ module.exports = (env) => {
7076 module : {
7177 rules : [ {
7278 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+ ]
7483 } ]
7584 } ,
7685 plugins : [
@@ -118,7 +127,10 @@ module.exports = (env) => {
118127 module : {
119128 rules : [ {
120129 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+ ]
122134 } ]
123135 } ,
124136 plugins : [
You can’t perform that action at this time.
0 commit comments