Import polyfills in your Next.js project
Use npm:
npm i next-with-polyfill -S
Or use yarn:
yarn add next-with-polyfill
in next.config.js
const withPlugins = require('next-compose-plugins');
const withPolyfill = require('next-with-polyfill');
module.exports = withPlugins([
withPolyfill([
'./node_modules/core-js/stable',
'./node_modules/regenerator-runtime/runtime',
]),
]);
const withPlugins = require('next-compose-plugins');
const withPolyfill = require('next-with-polyfill');
const {
CLIENT_STATIC_FILES_RUNTIME_POLYFILLS,
} = require('next/dist/next-server/lib/constants.js');
module.exports = withPlugins([
withPolyfill(
[
'./node_modules/core-js/stable',
'./node_modules/regenerator-runtime/runtime',
],
CLIENT_STATIC_FILES_RUNTIME_POLYFILLS,
),
]);
DefinitelyTyped only works because of contributions by users like you!
Follow the Angular git commit message specification
But, you can ignore the scope