umi-plugin-autopolyfill
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
,
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 arealways
andgated
. Settingalways
will return all requested polyfills to every browser. Settinggated
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