Bläddra i källkod

Prepare for webpack 2

j8
Lyubomir Marinov 8 år sedan
förälder
incheckning
e21eae0933
1 ändrade filer med 24 tillägg och 7 borttagningar
  1. 24
    7
      webpack.config.js

+ 24
- 7
webpack.config.js Visa fil

33
             NODE_ENV: JSON.stringify('production')
33
             NODE_ENV: JSON.stringify('production')
34
         }
34
         }
35
     }));
35
     }));
36
+
37
+    // While webpack will automatically insert UglifyJsPlugin when minimize is
38
+    // true, the defaults of UglifyJsPlugin in webpack 1 and webpack 2 are
39
+    // different. Explicitly state what we want even if we want defaults in
40
+    // order to prepare for webpack 2.
41
+    plugins.push(new webpack.optimize.UglifyJsPlugin({
42
+        compress: {
43
+            // It is nice to see warnings from UglifyJsPlugin that something is
44
+            // unused and, consequently, is removed. The default is false in
45
+            // webpack 2.
46
+            warnings: true
47
+        },
48
+
49
+        // Use the source map to map error message locations to modules. The
50
+        // default is false in webpack 2.
51
+        sourceMap: true
52
+    }));
36
 }
53
 }
37
 
54
 
38
 // The base Webpack configuration to bundle the JavaScript artifacts of
55
 // The base Webpack configuration to bundle the JavaScript artifacts of
56
             // as well.
73
             // as well.
57
 
74
 
58
             exclude: node_modules,
75
             exclude: node_modules,
59
-            loader: 'babel',
76
+            loader: 'babel-loader',
60
             query: {
77
             query: {
61
                 // XXX The require.resolve bellow solves failures to locate the
78
                 // XXX The require.resolve bellow solves failures to locate the
62
                 // presets when lib-jitsi-meet, for example, is npm linked in
79
                 // presets when lib-jitsi-meet, for example, is npm linked in
74
             // to be available in such a form by multiple jitsi-meet
91
             // to be available in such a form by multiple jitsi-meet
75
             // dependencies including AUI, lib-jitsi-meet.
92
             // dependencies including AUI, lib-jitsi-meet.
76
 
93
 
77
-            loader: 'expose?$!expose?jQuery',
94
+            loader: 'expose-loader?$!expose-loader?jQuery',
78
             test: /\/node_modules\/jquery\/.*\.js$/
95
             test: /\/node_modules\/jquery\/.*\.js$/
79
         }, {
96
         }, {
80
             // Disable AMD for the Strophe.js library or its imports will fail
97
             // Disable AMD for the Strophe.js library or its imports will fail
81
             // at runtime.
98
             // at runtime.
82
 
99
 
83
-            loader: 'imports?define=>false&this=>window',
100
+            loader: 'imports-loader?define=>false&this=>window',
84
             test: strophe
101
             test: strophe
85
         }, {
102
         }, {
86
             // Allow CSS to be imported into JavaScript.
103
             // Allow CSS to be imported into JavaScript.
87
 
104
 
88
             loaders: [
105
             loaders: [
89
-                'style',
90
-                'css'
106
+                'style-loader',
107
+                'css-loader'
91
             ],
108
             ],
92
             test: /\.css$/
109
             test: /\.css$/
93
         }, {
110
         }, {
95
             // by CSS into the output path.
112
             // by CSS into the output path.
96
 
113
 
97
             include: aui_css,
114
             include: aui_css,
98
-            loader: 'file',
115
+            loader: 'file-loader',
99
             query: {
116
             query: {
100
                 context: aui_css,
117
                 context: aui_css,
101
                 name: '[path][name].[ext]'
118
                 name: '[path][name].[ext]'
104
         }, {
121
         }, {
105
             // Enable the import of JSON files.
122
             // Enable the import of JSON files.
106
 
123
 
107
-            loader: 'json',
124
+            loader: 'json-loader',
108
             exclude: node_modules,
125
             exclude: node_modules,
109
             test: /\.json$/
126
             test: /\.json$/
110
         } ],
127
         } ],

Laddar…
Avbryt
Spara