Skip to content

Instantly share code, notes, and snippets.

@mornir
Created January 17, 2020 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mornir/b62ed60f806c5d6dbc76f4501d804e24 to your computer and use it in GitHub Desktop.
Save mornir/b62ed60f806c5d6dbc76f4501d804e24 to your computer and use it in GitHub Desktop.
Example of config for nuxt-polyfill module
polyfill: {
features: [
{
require: 'object.entries',
detect: () => 'entries' in window.Object,
install: entries => entries.shim(),
},
{
require: 'url-search-params-polyfill',
detect: () => 'URLSearchParams ' in window,
},
{
require: 'focus-visible',
},
{
require: 'intersection-observer',
detect: () => 'IntersectionObserver' in window,
},
{
require: 'smoothscroll-polyfill',
detect: () =>
'scrollBehavior' in document.documentElement.style &&
window.__forceSmoothScrollPolyfill__ !== true,
install: smoothscroll => smoothscroll.polyfill(),
},
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment