Skip to content

Commit

Permalink
feature: Manage multiple babel-polyfill imports
Browse files Browse the repository at this point in the history
  • Loading branch information
meikidd committed Jan 6, 2017
1 parent ff9fc21 commit 93ed333
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

require('babel-polyfill');

var _data = require('./data');

var _data2 = _interopRequireDefault(_data);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

if (typeof window !== 'undefined' && !window._babelPolyfill || typeof global !== 'undefined' && !global._babelPolyfill) {
require('babel-polyfill');
}

var ISO6391 = function ISO6391() {
(0, _classCallCheck3.default)(this, ISO6391);
};
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import 'babel-polyfill';
import LANGUAGES_LIST from './data';

if((typeof window !== 'undefined' && !window._babelPolyfill) ||
(typeof global !== 'undefined' && !global._babelPolyfill)) {
require('babel-polyfill')
}

export default class ISO6391 {
static getLanguages = (codes = []) => (
Object.entries(LANGUAGES_LIST)
Expand Down

0 comments on commit 93ed333

Please sign in to comment.