@web/dev-server-polyfill
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Dev server polyfill

Plugin to load polyfills during development. Uses @web/polyfills-loader internally.

Usage

web-dev-server.config.js:

import { polyfill } from '@web/dev-server-polyfill';

export default {
  plugins: [
    polyfill({
      scopedCustomElementRegistry: true,
    }),
  ],
};

You can find the supported polyfills here.

You can also provide custom polyfills:

web-dev-server.config.js:

import { polyfill } from '@web/dev-server-polyfill';

export default {
  plugins: [
    polyfill({
      custom: [
        {
          name: 'my-feature-polyfill',
          path: 'path/to/my/polyfill.js',
          test: "!('myFeature' in window)",
        },
      ],
    }),
  ],
};

You can find the configuration options for providing custom polyfills here.

Readme

Keywords

Package Sidebar

Install

npm i @web/dev-server-polyfill

Weekly Downloads

158

Version

1.0.4

License

MIT

Unpacked Size

4.88 kB

Total Files

8

Last publish

Collaborators

  • d4kmor
  • passle
  • jorenbroekema
  • bennyp
  • larsdenbakker
  • westbrook
  • modern-web