File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
const path = require ( 'path' ) ;
2
2
const webpack = require ( 'webpack' ) ;
3
- const UglifyJsPlugin = require ( 'uglifyjs -webpack-plugin' ) ;
3
+ const TerserPlugin = require ( 'terser -webpack-plugin' ) ;
4
4
5
5
const isProduction = process . env . NODE_ENV === 'production' ;
6
6
const mode = isProduction ? 'production' : 'development' ;
@@ -15,11 +15,11 @@ module.exports = {
15
15
} ,
16
16
devtool : 'source-map' ,
17
17
output : {
18
- path : path . resolve ( __dirname , 'dist' ) ,
18
+ path : path . join ( __dirname , 'dist' ) ,
19
+ library : libraryName ,
20
+ libraryTarget : 'umd' ,
19
21
filename : '[name].js' ,
20
- library : 'Logger' ,
21
- umdNamedDefine : true ,
22
- globalObject : `(typeof self !== 'undefined' ? self : this)`
22
+ globalObject : "typeof self !== 'undefined' ? self : this"
23
23
} ,
24
24
module : {
25
25
rules : [
@@ -37,7 +37,7 @@ module.exports = {
37
37
} ,
38
38
optimization : {
39
39
minimize : true ,
40
- minimizer : [ new UglifyJsPlugin ( { include : / \. m i n \. j s $ / } ) ]
40
+ minimizer : [ new TerserPlugin ( ) ]
41
41
} ,
42
42
plugins : [
43
43
new webpack . DefinePlugin ( {
You can’t perform that action at this time.
0 commit comments