File: use-webpack4.patch

package info (click to toggle)
node-source-map 0.7.0%2B%2Bdfsg2%2Breally.0.6.1-7~bpo10%2B1
  • links: PTS, VCS
  • area: main
  • in suites: buster-backports
  • size: 476 kB
  • sloc: javascript: 4,881; makefile: 16; sh: 4
file content (59 lines) | stat: -rw-r--r-- 1,302 bytes parent folder | download | duplicates (3)
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
+        })
+      ]
+    }
   }
 ];