Load babel-polyfill only when necessary.
This commit is contained in:
10
public/assets/polyfill.js
Normal file
10
public/assets/polyfill.js
Normal file
@@ -0,0 +1,10 @@
|
||||
// stupid old browsers
|
||||
if(typeof Promise === 'undefined') {
|
||||
(function(d, script) {
|
||||
script = d.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.async = false;
|
||||
script.src = '/assets/babel-polyfill.js';
|
||||
d.getElementsByTagName('head')[0].appendChild(script);
|
||||
}(document));
|
||||
}
|
||||
Reference in New Issue
Block a user