From 9f37d7bc2a2580b19c211521b68194faecd3e736 Mon Sep 17 00:00:00 2001 From: Dillon Date: Fri, 17 Apr 2020 00:25:42 +0800 Subject: [PATCH] feat(compatibility): add polyfill.io to improve compatibility (#236) --- assets/lib/polyfill.yml | 4 ++++ layouts/partials/assets.html | 3 +++ 2 files changed, 7 insertions(+) diff --git a/assets/lib/polyfill.yml b/assets/lib/polyfill.yml index 15000eb7..423fa891 100644 --- a/assets/lib/polyfill.yml +++ b/assets/lib/polyfill.yml @@ -6,3 +6,7 @@ algoliasearch: - Promise - Object.entries - Object.assign +theme: + - Object.values + - Promise + - fetch diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index b4788afd..bfe8fbe5 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -255,6 +255,9 @@ window.config = {{ jsonify $config | safeJS }}; +{{- /* Polyfill.io */ -}} +{{- partial "plugin/script.html" (dict "source" "https://polyfill.io/v3/polyfill.min.js?features=Element.prototype.closest%2CrequestAnimationFrame%2CCustomEvent%2CPromise%2CObject.entries%2CObject.assign%2CObject.values%2Cfetch") -}} + {{- range $scratch.Get "script" -}} {{- partial "plugin/script.html" . -}} {{- end -}}