File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed
Expand file tree Collapse file tree 1 file changed +24
-3
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 ExtractTextPlugin = require ( ' extract-text-webpack-plugin' ) ;
33const WebpackShellPlugin = require ( 'webpack-shell-plugin' ) ;
44const CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
55
@@ -42,8 +42,8 @@ const config = {
4242 {
4343 test : / \. c s s $ / ,
4444 use : ExtractTextPlugin . extract ( {
45- use : " css-loader" ,
46- fallback : " vue-loader" ,
45+ use : ' css-loader' ,
46+ fallback : ' vue-loader' ,
4747 } )
4848 } ,
4949 {
@@ -70,4 +70,25 @@ const config = {
7070 ]
7171} ;
7272
73+ if ( process . env . NODE_ENV === 'production' ) {
74+ config . devtool = '#cheap-module-source-map' ;
75+
76+ config . plugins = ( config . plugins || [ ] ) . concat ( [
77+ new webpack . DefinePlugin ( {
78+ 'process.env' : {
79+ NODE_ENV : '"production"'
80+ }
81+ } ) ,
82+ new webpack . optimize . UglifyJsPlugin ( {
83+ sourceMap : true ,
84+ compress : {
85+ warnings : false
86+ }
87+ } ) ,
88+ new webpack . LoaderOptionsPlugin ( {
89+ minimize : true
90+ } )
91+ ] ) ;
92+ }
93+
7394module . exports = config ;
You can’t perform that action at this time.
0 commit comments