next-with-polyfill

0.1.5 • Public • Published

next-with-polyfill

Import polyfills in your Next.js project

Test And Build Codecov Dependencies DevDependencies

npm package npm downloads

Usage

Install

Use npm:

npm i next-with-polyfill -S

Or use yarn:

yarn add next-with-polyfill

Config

Normal Config

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',
  ]),
]);

Change the Polyfill ChunkName

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, 
  ),
]);

Contribution

DefinitelyTyped only works because of contributions by users like you!

Git Message

Follow the Angular git commit message specification

But, you can ignore the scope

Dependencies (0)

    Dev Dependencies (12)

    Package Sidebar

    Install

    npm i next-with-polyfill

    Weekly Downloads

    23

    Version

    0.1.5

    License

    MIT

    Unpacked Size

    7.92 kB

    Total Files

    7

    Last publish

    Collaborators

    • xyy94813