1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
Adapt for newer webpack version in the archive
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -2,6 +2,7 @@
var fs = require("fs");
var path = require("path");
var webpack = require("webpack");
+var UglifyJsPlugin = require('uglifyjs-webpack-plugin');
var distDir = path.join(__dirname, "dist");
@@ -14,6 +15,7 @@
filename: "source-map.js",
library: "sourceMap",
libraryTarget: "umd",
+ globalObject: 'this',
},
},
@@ -25,6 +27,7 @@
filename: "source-map.debug.js",
library: "sourceMap",
libraryTarget: "umd",
+ globalObject: 'this',
},
devtool: "#inline-source-map"
},
@@ -37,13 +40,24 @@
filename: "source-map.min.js",
library: "sourceMap",
libraryTarget: "umd",
+ globalObject: 'this',
},
- plugins: [
- new webpack.optimize.UglifyJsPlugin({
- sourceMap: true
- })
- ],
- devtool: "#source-map"
+ devtool: "#source-map",
+ optimization: {
+ minimize: true,
+ minimizer: [
+ new UglifyJsPlugin({
+ cache: true,
+ parallel: true,
+ uglifyOptions: {
+ compress: false,
+ ecma: 6,
+ mangle: true
+ },
+ sourceMap: true
+ })
+ ]
+ }
}
];
|