Skip to content

Commit 3ed3fb1

Browse files
committed
feat (build) : remove core-js in app.js and load polyfill.io bundle
1 parent dc45306 commit 3ed3fb1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/js/app.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/**
22
* Main scripts file
33
*/
4-
// import 'core-js/stable'
5-
import 'regenerator-runtime/runtime'
4+
65
import './polyfill/picturefill'
76
import './polyfill/objectfit-polyfill'
87
import lazySizes from 'lazysizes'

src/templates/partials/footer.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,20 @@
2727
<?php require 'assets/img/icons/icons.svg'; ?>
2828

2929
<!-- Polyfill.io -->
30-
<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?features=NodeList.prototype.forEach%2CElement.prototype.closest"></script>
30+
<script src="https://cdn.polyfill.io/v3/polyfill.min.js?features=es5,es6,fetch,Array.prototype.includes,CustomEvent,Element.prototype.closest,NodeList.prototype.forEach"></script>
31+
3132

3233
<script>
3334
// inline loadJS
3435
function loadJS(e,t){"use strict";var n=window.document.getElementsByTagName("script")[0],o=window.document.createElement("script");return o.src=e,o.async=!0,n.parentNode.insertBefore(o,n),t&&"function"==typeof t&&(o.onload=t),o}
36+
3537
// then load your JS
3638
if (sessionStorage.getItem('fonts-loaded')) {
3739
// fonts cached, add class to document
38-
document.documentElement.classList.remove('fonts-loading');
40+
document.documentElement.classList.remove('fonts-loading')
3941
} else {
4042
// load script with font observing logic
41-
loadJS('assets/js/vendor_async/fonts-css-async.js');
43+
loadJS('assets/js/vendor_async/fonts-css-async.js')
4244
}
4345
</script>
4446

0 commit comments

Comments
 (0)