Skip to content

Commit

Permalink
Load each polyfill dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
phogel committed Aug 20, 2018
1 parent ddc5fdd commit 662d3dc
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,27 @@ export function generatePolyfills(){
require('core-js/modules/es7.object.values');
}

if(!Array.prototype.fill) {
require('core-js/modules/es6.array.fill');
}

if(!String.startsWith) {
require('core-js/modules/es6.string.starts-with');
}

if(!Object.assign) {
require('core-js/modules/es6.object.assign');
}

if(!window.Symbol) {
require('core-js/modules/es6.symbol');
}

if(window.Promise) {
return;
}
require('core-js/modules/es6.symbol');
require('core-js/modules/es6.object.assign');
require('core-js/modules/es6.string.starts-with');
require('core-js/modules/es6.array.iterator');
require('core-js/modules/es6.array.fill');
require('core-js/modules/es6.promise');

require('core-js/modules/es6.promise');
require('core-js/modules/_core');

if(typeof window.CustomEvent !== 'function') {
Expand Down

0 comments on commit 662d3dc

Please sign in to comment.