From a2291abf1d7f5dde8610c9ee4ace99ca311e64ab Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Wed, 13 Oct 2021 10:17:50 +0100 Subject: [PATCH 1/4] also transpile .mjs --- examples/webpack/config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/webpack/config.mjs b/examples/webpack/config.mjs index 12bd343a34..17cf361776 100644 --- a/examples/webpack/config.mjs +++ b/examples/webpack/config.mjs @@ -26,7 +26,7 @@ export default { module: { rules: [ { - test: /^((?!es2015-)[\s\S])*\.js$/, + test: /^((?!es2015-)[\s\S])*\.m?js$/, use: { loader: 'babel-loader', options: { From 895749707fedc9d8881d6cf29c44bfb022b449fa Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Wed, 13 Oct 2021 10:23:09 +0100 Subject: [PATCH 2/4] Use core-js cdn for some polyfills --- examples/resources/Promise.allSettled.js | 21 --------------------- examples/templates/example.html | 9 +++++---- site/index.html | 7 ++++--- 3 files changed, 9 insertions(+), 28 deletions(-) delete mode 100644 examples/resources/Promise.allSettled.js diff --git a/examples/resources/Promise.allSettled.js b/examples/resources/Promise.allSettled.js deleted file mode 100644 index e8822b2db4..0000000000 --- a/examples/resources/Promise.allSettled.js +++ /dev/null @@ -1,21 +0,0 @@ -if (typeof Promise !== 'undefined' && !Promise.allSettled && Array.from) { - Promise.allSettled = - function (promises) { - return Promise.all( - Array.from( - promises, - function (p) { - return p.then ( - function (value) { - return {status: 'fulfilled', value: value}; - } - ).catch( - function (reason) { - return {status: 'rejected', reason: reason}; - } - ); - } - ) - ) - }; -} diff --git a/examples/templates/example.html b/examples/templates/example.html index e60def9d5e..fdead5dd47 100644 --- a/examples/templates/example.html +++ b/examples/templates/example.html @@ -68,8 +68,8 @@ - - + + {{{ extraHead.local }}} {{{ css.tag }}} {{ title }} @@ -194,8 +194,9 @@ <title>{{ title }}</title> <!-- Pointer events polyfill for old browsers, see https://caniuse.com/#feat=pointer --> <script src="https://unpkg.com/elm-pep"></script> - <!-- The line below is only needed for old environments like Internet Explorer and Android 4.x --> - <script src="https://cdn.polyfill.io/v3/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL,TextDecoder,Number.isInteger"></script>{{#if extraHead.remote}} + <!-- The lines below are only needed for old environments like Internet Explorer and Android 4.x --> + <script src="https://cdn.polyfill.io/v3/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,TextDecoder"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/3.18.3/minified.js"></script>{{#if extraHead.remote}} {{ indent extraHead.remote spaces=4 }}{{/if}} <style> .map { diff --git a/site/index.html b/site/index.html index 740bfff0d1..6f5a356e6d 100644 --- a/site/index.html +++ b/site/index.html @@ -7,8 +7,9 @@ - - + + +