Skip to content

Commit

Permalink
fix(FEC-7528): multiple players cannot be loaded (#60)
Browse files Browse the repository at this point in the history
since only one instance of babel-polyfill is allowed, we have to require babel-polyfill conditionally only if not already exist
  • Loading branch information
yairans authored Nov 23, 2017
1 parent 933b234 commit b6b9bb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @flow
import 'babel-polyfill' // Important! must be first import to support older browsers compatibility
import PolyfillManager from './polyfills/polyfill-manager'
import './polyfills/all'
import getLogger, {getLogLevel, setLogLevel, LogLevel} from './utils/logger'
Expand Down
4 changes: 4 additions & 0 deletions src/polyfills/polyfill-manager.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// @flow
import getLogger from '../utils/logger'

if (!window._babelPolyfill){
require("babel-polyfill");
}

export default class PolyfillManager {
static _polyfills: Array<Function> = [];
static _logger: any = getLogger('PolyfillManager');
Expand Down

0 comments on commit b6b9bb6

Please sign in to comment.