polyfills
from Polyfill.io
JS-P100246 return (
47 <div>
48 <h1>Hello title</h1>
49 <script src="https://polyfill.io/v3/polyfill.min.js?features=WeakSet%2CPromise%2CPromise.prototype.finally%2Ces2015%2Ces5%2Ces6" />50 </div>
51 );
52 }
NuxtJS comes with some default polyfills,
and it is recommended not to use the same ones from polyfill.io
. Doing this would increase the page weight unnecessarily, affecting the page-loading performance.
Polyfills for IE11
compatibility are added by default. Along with this, polyfills for the following are also added by default:
fetch()
replaces whatwg-fetch
and unfetch
on the client-side, and isomorphic-unfetch
and node-fetch
on the server-side.URL
of NodeJS is supported through URL
.object-assign
, object.assign
, and core-js/object/assign
are supported by Object.assign()
ES6
features out of the boxNextJS also supports many features beyond ES6:
import { Head } from "next/document";
export class Card extends Head {
render() {
const data = Object.assign(source, target)
return (
<div>
<h1>Hello title</h1>
<script src="https://polyfill.io/v3/polyfill.min.js?features=Object.assign"></script>
</div>
);
}
}
import { Head } from "next/document";
export class Card extends Head {
render() {
const data = Object.assign(source, target)
return (
<div>
<h1>Hello title</h1>
</div>
);
}
}