Skip to content

Commit 9b05517

Browse files
committed
Enforce loading babel-polyfill first
This is to avoid loading anything before loading the polyfill, otherwise we risk loading dependencies (such as React) before it. This was causing the compatibility page to fail somehow. See facebook/react#8379 Fixes #6562
1 parent 6b2c853 commit 9b05517

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/vector/index.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,6 @@ limitations under the License.
1717

1818
'use strict';
1919

20-
// for ES6 stuff like startsWith() that Safari doesn't handle
21-
// and babel doesn't do by default
22-
// Note we use this, as well as the babel transform-runtime plugin
23-
// since transform-runtime does not cover instance methods
24-
// such as "foobar".includes("foo") which bits of our library
25-
// code use, but the babel transform-runtime plugin allows the
26-
// regenerator runtime to be injected early enough in the process
27-
// (it can't be here as it's too late: the alternative is to put
28-
// the babel-polyfill as the first 'entry' in the webpack config).
29-
// https://babeljs.io/docs/plugins/transform-runtime/
30-
require('babel-polyfill');
31-
3220
// Require common CSS here; this will make webpack process it into bundle.css.
3321
// Our own CSS (which is themed) is imported via separate webpack entry points
3422
// in webpack.config.js

webpack.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ if (!og_image_url) og_image_url = 'https://riot.im/app/themes/riot/img/logos/rio
88

99
module.exports = {
1010
entry: {
11+
main: [
12+
// Load this first to avoid issues where some imports (namely react)
13+
// potentially before babel-polyfill.
14+
'babel-polyfill',
15+
],
1116
"bundle": "./src/vector/index.js",
1217
"indexeddb-worker": "./src/vector/indexeddb-worker.js",
1318

0 commit comments

Comments
 (0)