Inject polyfills to HTML responses served by the web dev server.
npm install @chialab/wds-plugin-polyfill
Wds Plugin Polyfill • Inject polyfills to HTML responses served by the Web Dev Server.
---
``sh`
npm i @chialab/wds-plugin-polyfill -D
`sh`
yarn add @chialab/wds-plugin-polyfill -D
`js
import { polyfillPlugin } from '@chialab/wds-plugin-polyfill';
import { startDevServer } from '@web/dev-server';
await startDevServer({
plugins: [
polyfillPlugin({
minify: true,
features: {
'URL': {},
'URL.prototype.toJSON': {},
'URLSearchParams': {},
'Promise': {},
'Promise.prototype.finally': {},
'fetch': {},
},
}),
],
});
``
It uses the polyfill.io library under the hoods.
---
Wds Plugin Polyfill is released under the MIT license.