Sfoglia il codice sorgente

deps: update to webpack 4

dev1
Saúl Ibarra Corretgé 6 anni fa
parent
commit
883bf10411
3 ha cambiato i file con 1818 aggiunte e 1616 eliminazioni
  1. 1809
    1593
      package-lock.json
  2. 3
    3
      package.json
  3. 6
    20
      webpack.config.js

+ 1809
- 1593
package-lock.json
File diff soppresso perché troppo grande
Vedi File


+ 3
- 3
package.json Vedi File

51
     "karma-jasmine": "1.1.2",
51
     "karma-jasmine": "1.1.2",
52
     "karma-webpack": "3.0.0",
52
     "karma-webpack": "3.0.0",
53
     "precommit-hook": "3.0.0",
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
   "scripts": {
58
   "scripts": {
59
     "lint": "eslint . && flow",
59
     "lint": "eslint . && flow",

+ 6
- 20
webpack.config.js Vedi File

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

Loading…
Annulla
Salva