|
@@ -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$/
|