File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 1
1
const webpack = require ( 'webpack' ) ;
2
- const ExtractTextPlugin = require ( 'extract-text-webpack -plugin' ) ;
2
+ const MiniCssExtractPlugin = require ( 'mini-css-extract -plugin' ) ;
3
3
const ESLintPlugin = require ( 'eslint-webpack-plugin' ) ;
4
4
const pkg = require ( '../package.json' ) ;
5
5
@@ -24,7 +24,8 @@ module.exports = {
24
24
25
25
//是否启用压缩
26
26
optimization : {
27
- minimize : false
27
+ minimize : false ,
28
+ noEmitOnErrors : true
28
29
} ,
29
30
//不显示打包文件大小相关警告
30
31
performance : {
@@ -58,11 +59,7 @@ module.exports = {
58
59
} ,
59
60
css : {
60
61
test : / \. c s s $ / ,
61
- use : ExtractTextPlugin . extract ( {
62
- use : {
63
- loader : 'css-loader'
64
- }
65
- } )
62
+ use : [ MiniCssExtractPlugin . loader , 'css-loader' ]
66
63
}
67
64
}
68
65
} ,
@@ -79,8 +76,7 @@ module.exports = {
79
76
plugins : function ( libName , productName ) {
80
77
return [
81
78
new webpack . BannerPlugin ( this . bannerInfo ( productName ) ) ,
82
- new ExtractTextPlugin ( `./${ productName } .css` ) ,
83
- new webpack . NoEmitOnErrorsPlugin ( ) ,
79
+ new MiniCssExtractPlugin ( { filename :`./${ productName } .css` } ) ,
84
80
new ESLintPlugin ( { failOnError : true , files : 'src' } )
85
81
] ;
86
82
}
Original file line number Diff line number Diff line change 79
79
"eslint-plugin-import" : " ^2.22.1" ,
80
80
"eslint-webpack-plugin" : " ^2.1.0" ,
81
81
"express" : " ^4.16.3" ,
82
- "extract-text-webpack-plugin" : " ^4.0.0-beta.0" ,
83
82
"get-pixels" : " ^3.3.0" ,
84
83
"image-size" : " ^0.9.1" ,
85
84
"istanbul" : " ^0.4.5" ,
93
92
"karma-jasmine" : " ^3.3.1" ,
94
93
"karma-sonarqube-unit-reporter" : " 0.0.21" ,
95
94
"karma-teamcity-reporter" : " ^1.1.0" ,
95
+ "mini-css-extract-plugin" : " ^1.0.0" ,
96
96
"mock-socket" : " ^9.0.2" ,
97
97
"nightwatch" : " ^1.3.1" ,
98
98
"open" : " ^7.0.0" ,
You can’t perform that action at this time.
0 commit comments