|
@@ -1,96 +1,6 @@
|
1
|
|
-/* global __dirname */
|
2
|
|
-
|
3
|
1
|
const process = require('process');
|
4
|
|
-const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
5
|
|
-
|
6
|
|
-const analyzeBundle = process.argv.indexOf('--analyze-bundle') !== -1;
|
7
|
|
-
|
8
|
|
-const minimize
|
9
|
|
- = process.argv.indexOf('-p') !== -1
|
10
|
|
- || process.argv.indexOf('--optimize-minimize') !== -1;
|
11
|
|
-
|
12
|
|
-const config = {
|
13
|
|
- // The inline-source-map is used to allow debugging the unit tests with Karma
|
14
|
|
- devtool: minimize ? 'source-map' : 'inline-source-map',
|
15
|
|
- mode: minimize ? 'production' : 'development',
|
16
|
|
- module: {
|
17
|
|
- rules: [ {
|
18
|
|
- // Version this build of the lib-jitsi-meet library.
|
19
|
|
-
|
20
|
|
- loader: 'string-replace-loader',
|
21
|
|
- options: {
|
22
|
|
- flags: 'g',
|
23
|
|
- replace:
|
24
|
|
- process.env.LIB_JITSI_MEET_COMMIT_HASH || 'development',
|
25
|
|
- search: '{#COMMIT_HASH#}'
|
26
|
|
- },
|
27
|
|
- test: `${__dirname}/JitsiMeetJS.js`
|
28
|
|
- }, {
|
29
|
|
- // Transpile ES2015 (aka ES6) to ES5.
|
30
|
|
-
|
31
|
|
- exclude: [
|
32
|
|
- new RegExp(`${__dirname}/node_modules/(?!@jitsi/js-utils)`)
|
33
|
|
- ],
|
34
|
|
- loader: 'babel-loader',
|
35
|
|
- options: {
|
36
|
|
- presets: [
|
37
|
|
- [
|
38
|
|
- '@babel/preset-env',
|
39
|
|
-
|
40
|
|
- // Tell babel to avoid compiling imports into CommonJS
|
41
|
|
- // so that webpack may do tree shaking.
|
42
|
|
- {
|
43
|
|
- modules: false,
|
44
|
2
|
|
45
|
|
- // Specify our target browsers so no transpiling is
|
46
|
|
- // done unnecessarily. For browsers not specified
|
47
|
|
- // here, the ES2015+ profile will be used.
|
48
|
|
- targets: {
|
49
|
|
- chrome: 58,
|
50
|
|
- electron: 2,
|
51
|
|
- firefox: 54,
|
52
|
|
- safari: 11
|
53
|
|
- }
|
54
|
|
- }
|
55
|
|
- ],
|
56
|
|
- '@babel/preset-flow'
|
57
|
|
- ],
|
58
|
|
- plugins: [
|
59
|
|
- '@babel/plugin-transform-flow-strip-types',
|
60
|
|
- '@babel/plugin-proposal-class-properties',
|
61
|
|
- '@babel/plugin-proposal-export-namespace-from'
|
62
|
|
- ]
|
63
|
|
- },
|
64
|
|
- test: /\.js$/
|
65
|
|
- } ]
|
66
|
|
- },
|
67
|
|
- node: {
|
68
|
|
- // Allow the use of the real filename of the module being executed. By
|
69
|
|
- // default Webpack does not leak path-related information and provides a
|
70
|
|
- // value that is a mock (/index.js).
|
71
|
|
- __filename: true
|
72
|
|
- },
|
73
|
|
- optimization: {
|
74
|
|
- concatenateModules: minimize
|
75
|
|
- },
|
76
|
|
- output: {
|
77
|
|
- filename: `[name]${minimize ? '.min' : ''}.js`,
|
78
|
|
- path: process.cwd(),
|
79
|
|
- sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map`
|
80
|
|
- },
|
81
|
|
- performance: {
|
82
|
|
- hints: minimize ? 'error' : false,
|
83
|
|
- maxAssetSize: 750 * 1024,
|
84
|
|
- maxEntrypointSize: 750 * 1024
|
85
|
|
- },
|
86
|
|
- plugins: [
|
87
|
|
- analyzeBundle
|
88
|
|
- && new BundleAnalyzerPlugin({
|
89
|
|
- analyzerMode: 'disabled',
|
90
|
|
- generateStatsFile: true
|
91
|
|
- })
|
92
|
|
- ].filter(Boolean)
|
93
|
|
-};
|
|
3
|
+const config = require('./webpack-shared-config');
|
94
|
4
|
|
95
|
5
|
module.exports = [
|
96
|
6
|
Object.assign({}, config, {
|