Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/modernweb-dev/dev-server-polyfill
Dev server plugin for loading polyfills
https://github.com/modernweb-dev/dev-server-polyfill
Last synced: 6 days ago
JSON representation
Dev server plugin for loading polyfills
- Host: GitHub
- URL: https://github.com/modernweb-dev/dev-server-polyfill
- Owner: modernweb-dev
- Created: 2024-01-11T10:26:44.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-11T13:35:09.000Z (7 months ago)
- Last Synced: 2024-04-13T23:52:46.967Z (7 months ago)
- Language: TypeScript
- Size: 271 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Dev server polyfill
Plugin to load polyfills during development. Uses [`@web/polyfills-loader`](https://modern-web.dev/docs/building/polyfills-loader/) internally.
## Usage
`web-dev-server.config.js`:
```js
import { polyfill } from '@web/dev-server-polyfill';export default {
plugins: [
polyfill({
scopedCustomElementRegistry: true,
}),
],
};
```You can find the supported polyfills [here](https://modern-web.dev/docs/building/polyfills-loader/#polyfills).
You can also provide custom polyfills:
`web-dev-server.config.js`:
```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](https://modern-web.dev/docs/building/polyfills-loader/#custom-polyfills).