umi-plugin-autopolyfill

1.0.2 • Public • Published

umi-plugin-autopolyfill

NPM version NPM downloads

Get only the polyfills that are needed by the requesting browser.

Umi plugin for polyfill.io

Install

npm i umi-plugin-autopolyfill --save-dev

Usage

Configure in .umirc.js,

export default {
  plugins: [
    ['umi-plugin-autopolyfill', {
      features: ['es5', 'es6', 'Array.from'],
      flags: 'gated'
    }],
  ],
}

Options

  • features: Array Polyfill you want to request. See all available polyfills
  • flags: gated | always Configuration settings for every polyfill being requested. Possible values are always and gated. Setting always will return all requested polyfills to every browser. Setting gated will wrap every polyfill within a feature detection, only adding the polyfill if the feature was not detected. To enable both settings, separate them with a comma E.G. always,gated.
  • endpoint: string The polyfill server endpoint. Default to //polyfill.io/v3/polyfill.min.js

LICENSE

MIT

Package Sidebar

Install

npm i umi-plugin-autopolyfill

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

3.65 kB

Total Files

4

Last publish

Collaborators

  • djyde