Browse Source

deps: update to webpack 4

dev1
Saúl Ibarra Corretgé 6 years ago
parent
commit
883bf10411
3 changed files with 1818 additions and 1616 deletions
  1. 1809
    1593
      package-lock.json
  2. 3
    3
      package.json
  3. 6
    20
      webpack.config.js

+ 1809
- 1593
package-lock.json
File diff suppressed because it is too large
View File


+ 3
- 3
package.json View File

@@ -51,9 +51,9 @@
51 51
     "karma-jasmine": "1.1.2",
52 52
     "karma-webpack": "3.0.0",
53 53
     "precommit-hook": "3.0.0",
54
-    "string-replace-loader": "1.3.0",
55
-    "uglifyjs-webpack-plugin": "1.2.2",
56
-    "webpack": "3.9.1"
54
+    "string-replace-loader": "2.1.1",
55
+    "webpack": "4.26.1",
56
+    "webpack-cli": "3.1.2"
57 57
   },
58 58
   "scripts": {
59 59
     "lint": "eslint . && flow",

+ 6
- 20
webpack.config.js View File

@@ -1,31 +1,14 @@
1 1
 /* global __dirname */
2 2
 
3 3
 const process = require('process');
4
-const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
5
-const webpack = require('webpack');
6 4
 
7 5
 const minimize
8 6
     = process.argv.indexOf('-p') !== -1
9 7
         || process.argv.indexOf('--optimize-minimize') !== -1;
10
-const plugins = [
11
-    new webpack.LoaderOptionsPlugin({
12
-        debug: !minimize,
13
-        minimize
14
-    })
15
-];
16
-
17
-if (minimize) {
18
-    plugins.push(new webpack.optimize.ModuleConcatenationPlugin());
19
-    plugins.push(new UglifyJsPlugin({
20
-        cache: true,
21
-        extractComments: true,
22
-        parallel: true,
23
-        sourceMap: true
24
-    }));
25
-}
26 8
 
27 9
 const config = {
28 10
     devtool: 'source-map',
11
+    mode: minimize ? 'development' : 'production',
29 12
     module: {
30 13
         rules: [ {
31 14
             // Version this build of the lib-jitsi-meet library.
@@ -71,11 +54,14 @@ const config = {
71 54
         // value that is a mock (/index.js).
72 55
         __filename: true
73 56
     },
57
+    optimization: {
58
+        concatenateModules: minimize
59
+    },
74 60
     output: {
75 61
         filename: `[name]${minimize ? '.min' : ''}.js`,
62
+        path: process.cwd(),
76 63
         sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map`
77
-    },
78
-    plugins
64
+    }
79 65
 };
80 66
 
81 67
 module.exports = [

Loading…
Cancel
Save