|
@@ -1,31 +1,14 @@
|
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
|
const minimize
|
8
|
6
|
= process.argv.indexOf('-p') !== -1
|
9
|
7
|
|| process.argv.indexOf('--optimize-minimize') !== -1;
|
10
|
|
-const plugins = [
|
11
|
|
- new webpack.LoaderOptionsPlugin({
|
12
|
|
- debug: !minimize,
|
13
|
|
- minimize
|
14
|
|
- })
|
15
|
|
-];
|
16
|
|
-
|
17
|
|
-if (minimize) {
|
18
|
|
- plugins.push(new webpack.optimize.ModuleConcatenationPlugin());
|
19
|
|
- plugins.push(new UglifyJsPlugin({
|
20
|
|
- cache: true,
|
21
|
|
- extractComments: true,
|
22
|
|
- parallel: true,
|
23
|
|
- sourceMap: true
|
24
|
|
- }));
|
25
|
|
-}
|
26
|
8
|
|
27
|
9
|
const config = {
|
28
|
10
|
devtool: 'source-map',
|
|
11
|
+ mode: minimize ? 'development' : 'production',
|
29
|
12
|
module: {
|
30
|
13
|
rules: [ {
|
31
|
14
|
// Version this build of the lib-jitsi-meet library.
|
|
@@ -71,11 +54,14 @@ const config = {
|
71
|
54
|
// value that is a mock (/index.js).
|
72
|
55
|
__filename: true
|
73
|
56
|
},
|
|
57
|
+ optimization: {
|
|
58
|
+ concatenateModules: minimize
|
|
59
|
+ },
|
74
|
60
|
output: {
|
75
|
61
|
filename: `[name]${minimize ? '.min' : ''}.js`,
|
|
62
|
+ path: process.cwd(),
|
76
|
63
|
sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map`
|
77
|
|
- },
|
78
|
|
- plugins
|
|
64
|
+ }
|
79
|
65
|
};
|
80
|
66
|
|
81
|
67
|
module.exports = [
|