Ver código fonte

Remove .babelrc to simplify React Native support

React Native's module bundler (aka packager) has its default Babel
preset - react-native/babel-preset - which it uses in the absence of a
custom .babelrc. Unfortunately, the default may be tripped by the
presence of a .babelrc in dependencies. Additionally, if the default
does not get tripped, the npm install of lib-jitsi-meet as a dependency
may fall into a recursion in which Babel attempts to transpile
react-native/babel-preset. To reduce the risks of stumbling upon such
problems, move Babel's configuration inside the Webpack configuration
file.
master
Lyubomir Marinov 8 anos atrás
pai
commit
1edebf83ae
3 arquivos alterados com 31 adições e 35 exclusões
  1. 0
    8
      .babelrc
  2. 0
    2
      package.json
  3. 31
    25
      webpack.config.js

+ 0
- 8
.babelrc Ver arquivo

@@ -1,8 +0,0 @@
1
-{
2
-    "plugins": [
3
-        "transform-object-rest-spread"
4
-    ],
5
-    "presets": [
6
-        "es2015"
7
-    ]
8
-}

+ 0
- 2
package.json Ver arquivo

@@ -38,10 +38,8 @@
38 38
   "devDependencies": {
39 39
     "babel-core": "*",
40 40
     "babel-loader": "*",
41
-    "babel-plugin-transform-object-rest-spread": "*",
42 41
     "babel-polyfill": "*",
43 42
     "babel-preset-es2015": "6.14.0",
44
-    "babel-register": "*",
45 43
     "clean-css": "*",
46 44
     "css-loader": "*",
47 45
     "eslint": "*",

webpack.config.babel.js → webpack.config.js Ver arquivo

@@ -1,16 +1,18 @@
1 1
 /* global __dirname */
2 2
 
3
-import process from 'process';
3
+require('babel-polyfill'); // Define Object.assign() from ES6 in ES5.
4 4
 
5
-const aui_css = __dirname + '/node_modules/@atlassian/aui/dist/aui/css/';
6
-const minimize
5
+var process = require('process');
6
+
7
+var aui_css = __dirname + '/node_modules/@atlassian/aui/dist/aui/css/';
8
+var minimize
7 9
     = process.argv.indexOf('-p') != -1
8 10
         || process.argv.indexOf('--optimize-minimize') != -1;
9
-const strophe = /\/node_modules\/strophe(js-plugins)?\/.*\.js$/;
11
+var strophe = /\/node_modules\/strophe(js-plugins)?\/.*\.js$/;
10 12
 
11 13
 // The base Webpack configuration to bundle the JavaScript artifacts of
12 14
 // jitsi-meet such as app.bundle.js and external_api.js.
13
-const config = {
15
+var config = {
14 16
     devtool: 'source-map',
15 17
     module: {
16 18
         loaders: [{
@@ -18,6 +20,11 @@ const config = {
18 20
 
19 21
             exclude: __dirname + '/node_modules/',
20 22
             loader: 'babel',
23
+            query: {
24
+                presets: [
25
+                    'es2015'
26
+                ]
27
+            },
21 28
             test: /\.js$/
22 29
         },{
23 30
             // Expose jquery as the globals $ and jQuery because it is expected
@@ -91,27 +98,26 @@ const config = {
91 98
     }
92 99
 };
93 100
 
94
-export default [{
101
+module.exports = [
102
+
95 103
     // The Webpack configuration to bundle app.bundle.js (aka APP).
104
+    Object.assign({}, config, {
105
+        entry: {
106
+            'app.bundle': './app.js'
107
+        },
108
+        output: Object.assign({}, config.output, {
109
+            library: 'APP'
110
+        })
111
+    }),
96 112
 
97
-    ...config,
98
-    entry: {
99
-       'app.bundle': './app.js'
100
-    },
101
-    output: {
102
-        ...config.output,
103
-        library: 'APP'
104
-    }
105
-}, {
106 113
     // The Webpack configuration to bundle external_api.js (aka
107 114
     // JitsiMeetExternalAPI).
108
-
109
-    ...config,
110
-    entry: {
111
-       'external_api': './modules/API/external/external_api.js'
112
-    },
113
-    output: {
114
-        ...config.output,
115
-        library: 'JitsiMeetExternalAPI'
116
-    }
117
-}];
115
+    Object.assign({}, config, {
116
+        entry: {
117
+            'external_api': './modules/API/external/external_api.js'
118
+        },
119
+        output: Object.assign({}, config.output, {
120
+            library: 'JitsiMeetExternalAPI'
121
+        })
122
+    })
123
+];

Carregando…
Cancelar
Salvar