Lyubo Marinov před 8 roky
rodič
revize
b89755d853
2 změnil soubory, kde provedl 18 přidání a 6 odebrání
  1. 1
    1
      package.json
  2. 17
    5
      webpack.config.js

+ 1
- 1
package.json Zobrazit soubor

@@ -46,7 +46,7 @@
46 46
     "karma-webpack": "1.8.1",
47 47
     "precommit-hook": "3.0.0",
48 48
     "string-replace-loader": "1.2.0",
49
-    "webpack": "1.14.0"
49
+    "webpack": "2.6.1"
50 50
   },
51 51
   "scripts": {
52 52
     "lint": "jshint . && eslint . && flow",

+ 17
- 5
webpack.config.js Zobrazit soubor

@@ -7,7 +7,12 @@ const webpack = require('webpack');
7 7
 const minimize
8 8
     = process.argv.indexOf('-p') !== -1
9 9
         || process.argv.indexOf('--optimize-minimize') !== -1;
10
-const plugins = [];
10
+const plugins = [
11
+    new webpack.LoaderOptionsPlugin({
12
+        debug: !minimize,
13
+        minimize
14
+    })
15
+];
11 16
 
12 17
 if (minimize) {
13 18
     // While webpack will automatically insert UglifyJsPlugin when minimize is
@@ -21,6 +26,7 @@ if (minimize) {
21 26
             // webpack 2.
22 27
             warnings: true
23 28
         },
29
+        extractComments: true,
24 30
 
25 31
         // Use the source map to map error message locations to modules. The
26 32
         // default is false in webpack 2.
@@ -34,11 +40,11 @@ module.exports = {
34 40
         'lib-jitsi-meet': './index.js'
35 41
     },
36 42
     module: {
37
-        loaders: [ {
43
+        rules: [ {
38 44
             // Version this build of the lib-jitsi-meet library.
39 45
 
40 46
             loader: 'string-replace-loader',
41
-            query: {
47
+            options: {
42 48
                 flags: 'g',
43 49
                 replace:
44 50
                     child_process.execSync( // eslint-disable-line camelcase
@@ -62,9 +68,15 @@ module.exports = {
62 68
                 `${__dirname}/node_modules/`
63 69
             ],
64 70
             loader: 'babel-loader',
65
-            query: {
71
+            options: {
66 72
                 presets: [
67
-                    'es2015'
73
+                    [
74
+                        'es2015',
75
+
76
+                        // Tell babel to avoid compiling imports into CommonJS
77
+                        // so that webpack may do tree shaking.
78
+                        { modules: false }
79
+                    ]
68 80
                 ]
69 81
             },
70 82
             test: /\.js$/

Načítá se…
Zrušit
Uložit