File tree Expand file tree Collapse file tree 1 file changed +29
-8
lines changed
Expand file tree Collapse file tree 1 file changed +29
-8
lines changed Original file line number Diff line number Diff line change 1- const webpack = require ( ' webpack' ) ;
2- const path = require ( ' path' ) ;
3- const UglifyJSPlugin = require ( ' uglifyjs-webpack-plugin' ) ;
1+ const webpack = require ( " webpack" ) ;
2+ const path = require ( " path" ) ;
3+ const UglifyJsPlugin = require ( " uglifyjs-webpack-plugin" ) ;
44
5- module . exports = ( env => {
5+ module . exports = env => {
66
77 if ( ! env ) env = { production : false , karma : false } ;
88
99 let mode = env . production ? "production" : "development" ;
1010 let tsconfig = ! env . karma ? "tsconfig.json" : "tsconfig.test.json" ;
11- let output = env . production ? "dist" : "dev " ;
11+ let output = env . production ? "dist" : "dist-test " ;
1212 let filename = env . production ? "robotlegs-signalcommandmap.min.js" : "robotlegs-signalcommandmap.js" ;
1313
1414 return {
1515 mode : mode ,
16+
1617 entry : {
1718 main : path . join ( __dirname , "src/index.ts" )
1819 } ,
@@ -48,12 +49,32 @@ module.exports = (env => {
4849
4950 plugins : (
5051 ( env . production )
51- ? [ new UglifyJSPlugin ( ) ]
52+ ? [ ]
5253 : [ new webpack . SourceMapDevToolPlugin ( { test : / \. t s $ / i } ) ]
5354 ) ,
5455
56+ optimization :
57+ ( env . production )
58+ ? {
59+ concatenateModules : true ,
60+ minimize : true ,
61+ minimizer : [
62+ new UglifyJsPlugin ( {
63+ cache : true ,
64+ parallel : 4 ,
65+ uglifyOptions : {
66+ output : {
67+ comments : false
68+ }
69+ }
70+ } )
71+ ]
72+ }
73+ : { }
74+ ,
75+
5576 resolve : {
56- extensions : [ ' .ts' , ' .js' , ' .json' ]
77+ extensions : [ " .ts" , " .js" , " .json" ]
5778 }
5879 }
59- } ) ;
80+ } ;
You can’t perform that action at this time.
0 commit comments