|
@@ -1,8 +1,6 @@
|
1
|
1
|
/* global __dirname */
|
2
|
2
|
|
3
|
3
|
const process = require('process');
|
4
|
|
-const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
5
|
|
-const webpack = require('webpack');
|
6
|
4
|
|
7
|
5
|
/**
|
8
|
6
|
* The URL of the Jitsi Meet deployment to be proxy to in the context of
|
|
@@ -15,31 +13,6 @@ const minimize
|
15
|
13
|
= process.argv.indexOf('-p') !== -1
|
16
|
14
|
|| process.argv.indexOf('--optimize-minimize') !== -1;
|
17
|
15
|
|
18
|
|
-const plugins = [
|
19
|
|
- new webpack.LoaderOptionsPlugin({
|
20
|
|
- debug: !minimize,
|
21
|
|
- minimize
|
22
|
|
- })
|
23
|
|
-];
|
24
|
|
-
|
25
|
|
-if (minimize) {
|
26
|
|
- // XXX Webpack's command line argument -p is not enough. Further
|
27
|
|
- // optimizations are made possible by the use of DefinePlugin and NODE_ENV
|
28
|
|
- // with value 'production'. For example, React takes advantage of these.
|
29
|
|
- plugins.push(new webpack.DefinePlugin({
|
30
|
|
- 'process.env': {
|
31
|
|
- NODE_ENV: JSON.stringify('production')
|
32
|
|
- }
|
33
|
|
- }));
|
34
|
|
- plugins.push(new webpack.optimize.ModuleConcatenationPlugin());
|
35
|
|
- plugins.push(new UglifyJsPlugin({
|
36
|
|
- cache: true,
|
37
|
|
- extractComments: true,
|
38
|
|
- parallel: true,
|
39
|
|
- sourceMap: true
|
40
|
|
- }));
|
41
|
|
-}
|
42
|
|
-
|
43
|
16
|
// The base Webpack configuration to bundle the JavaScript artifacts of
|
44
|
17
|
// jitsi-meet such as app.bundle.js and external_api.js.
|
45
|
18
|
const config = {
|
|
@@ -55,6 +28,7 @@ const config = {
|
55
|
28
|
}
|
56
|
29
|
},
|
57
|
30
|
devtool: 'source-map',
|
|
31
|
+ mode: minimize ? 'development' : 'production',
|
58
|
32
|
module: {
|
59
|
33
|
rules: [ {
|
60
|
34
|
// Transpile ES2015 (aka ES6) to ES5. Accept the JSX syntax by React
|
|
@@ -112,13 +86,16 @@ const config = {
|
112
|
86
|
// value that is a mock (/index.js).
|
113
|
87
|
__filename: true
|
114
|
88
|
},
|
|
89
|
+ optimization: {
|
|
90
|
+ concatenateModules: minimize,
|
|
91
|
+ minimize
|
|
92
|
+ },
|
115
|
93
|
output: {
|
116
|
94
|
filename: `[name]${minimize ? '.min' : ''}.js`,
|
117
|
95
|
path: `${__dirname}/build`,
|
118
|
96
|
publicPath: '/libs/',
|
119
|
97
|
sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map`
|
120
|
98
|
},
|
121
|
|
- plugins,
|
122
|
99
|
resolve: {
|
123
|
100
|
alias: {
|
124
|
101
|
jquery: `jquery/dist/jquery${minimize ? '.min' : ''}.js`
|