|
@@ -33,6 +33,23 @@ if (minimize) {
|
33
|
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
|
55
|
// The base Webpack configuration to bundle the JavaScript artifacts of
|
|
@@ -56,7 +73,7 @@ var config = {
|
56
|
73
|
// as well.
|
57
|
74
|
|
58
|
75
|
exclude: node_modules,
|
59
|
|
- loader: 'babel',
|
|
76
|
+ loader: 'babel-loader',
|
60
|
77
|
query: {
|
61
|
78
|
// XXX The require.resolve bellow solves failures to locate the
|
62
|
79
|
// presets when lib-jitsi-meet, for example, is npm linked in
|
|
@@ -74,20 +91,20 @@ var config = {
|
74
|
91
|
// to be available in such a form by multiple jitsi-meet
|
75
|
92
|
// dependencies including AUI, lib-jitsi-meet.
|
76
|
93
|
|
77
|
|
- loader: 'expose?$!expose?jQuery',
|
|
94
|
+ loader: 'expose-loader?$!expose-loader?jQuery',
|
78
|
95
|
test: /\/node_modules\/jquery\/.*\.js$/
|
79
|
96
|
}, {
|
80
|
97
|
// Disable AMD for the Strophe.js library or its imports will fail
|
81
|
98
|
// at runtime.
|
82
|
99
|
|
83
|
|
- loader: 'imports?define=>false&this=>window',
|
|
100
|
+ loader: 'imports-loader?define=>false&this=>window',
|
84
|
101
|
test: strophe
|
85
|
102
|
}, {
|
86
|
103
|
// Allow CSS to be imported into JavaScript.
|
87
|
104
|
|
88
|
105
|
loaders: [
|
89
|
|
- 'style',
|
90
|
|
- 'css'
|
|
106
|
+ 'style-loader',
|
|
107
|
+ 'css-loader'
|
91
|
108
|
],
|
92
|
109
|
test: /\.css$/
|
93
|
110
|
}, {
|
|
@@ -95,7 +112,7 @@ var config = {
|
95
|
112
|
// by CSS into the output path.
|
96
|
113
|
|
97
|
114
|
include: aui_css,
|
98
|
|
- loader: 'file',
|
|
115
|
+ loader: 'file-loader',
|
99
|
116
|
query: {
|
100
|
117
|
context: aui_css,
|
101
|
118
|
name: '[path][name].[ext]'
|
|
@@ -104,7 +121,7 @@ var config = {
|
104
|
121
|
}, {
|
105
|
122
|
// Enable the import of JSON files.
|
106
|
123
|
|
107
|
|
- loader: 'json',
|
|
124
|
+ loader: 'json-loader',
|
108
|
125
|
exclude: node_modules,
|
109
|
126
|
test: /\.json$/
|
110
|
127
|
} ],
|