npm.io
0.19.1 • Published 8 months ago

@chialab/wds-plugin-polyfill

Licence
MIT
Version
0.19.1
Deps
1
Size
6 kB
Vulns
0
Weekly
0
Stars
183

Wds Plugin Polyfill

Inject polyfills to HTML responses served by the Web Dev Server.

Since we are moving away from the RNA cli, we are discontinuing the development of Web Dev Server plugins.

NPM

Install

npm i @chialab/wds-plugin-polyfill -D
yarn add @chialab/wds-plugin-polyfill -D
pnpm add @chialab/wds-plugin-polyfill -D

Usage

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.

License

Wds Plugin Polyfill is released under the MIT license.

Keywords