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 11const webpack = require ( 'webpack' ) ;
2- const ExtractTextPlugin = require ( 'extract-text-webpack -plugin' ) ;
2+ const MiniCssExtractPlugin = require ( 'mini-css-extract -plugin' ) ;
33const ESLintPlugin = require ( 'eslint-webpack-plugin' ) ;
44const pkg = require ( '../package.json' ) ;
55
@@ -24,7 +24,8 @@ module.exports = {
2424
2525 //是否启用压缩
2626 optimization : {
27- minimize : false
27+ minimize : false ,
28+ noEmitOnErrors : true
2829 } ,
2930 //不显示打包文件大小相关警告
3031 performance : {
@@ -58,11 +59,7 @@ module.exports = {
5859 } ,
5960 css : {
6061 test : / \. c s s $ / ,
61- use : ExtractTextPlugin . extract ( {
62- use : {
63- loader : 'css-loader'
64- }
65- } )
62+ use : [ MiniCssExtractPlugin . loader , 'css-loader' ]
6663 }
6764 }
6865 } ,
@@ -79,8 +76,7 @@ module.exports = {
7976 plugins : function ( libName , productName ) {
8077 return [
8178 new webpack . BannerPlugin ( this . bannerInfo ( productName ) ) ,
82- new ExtractTextPlugin ( `./${ productName } .css` ) ,
83- new webpack . NoEmitOnErrorsPlugin ( ) ,
79+ new MiniCssExtractPlugin ( { filename :`./${ productName } .css` } ) ,
8480 new ESLintPlugin ( { failOnError : true , files : 'src' } )
8581 ] ;
8682 }
Original file line number Diff line number Diff line change 7979 "eslint-plugin-import" : " ^2.22.1" ,
8080 "eslint-webpack-plugin" : " ^2.1.0" ,
8181 "express" : " ^4.16.3" ,
82- "extract-text-webpack-plugin" : " ^4.0.0-beta.0" ,
8382 "get-pixels" : " ^3.3.0" ,
8483 "image-size" : " ^0.9.1" ,
8584 "istanbul" : " ^0.4.5" ,
9392 "karma-jasmine" : " ^3.3.1" ,
9493 "karma-sonarqube-unit-reporter" : " 0.0.21" ,
9594 "karma-teamcity-reporter" : " ^1.1.0" ,
95+ "mini-css-extract-plugin" : " ^1.0.0" ,
9696 "mock-socket" : " ^9.0.2" ,
9797 "nightwatch" : " ^1.3.1" ,
9898 "open" : " ^7.0.0" ,
You can’t perform that action at this time.
0 commit comments