Web polyfill
An automatic CDN service for Web polyfills, which is based on TypeScript, Node.js & UnPkg.
Usage example
- Find a Web feature in the Polyfill directory
- Copy the
class
name of the selected polyfill, then write it into a specific Script URL (shown below) - the above script will detect whether current environment needs to be patched, then load the polyfill script original from UnPkg
Web pages
<head>
<script src="https://polyfill.web-cell.dev/feature/ResizeObserver.js"></script>
</head>
Web workers
self.importScripts('https://polyfill.web-cell.dev/feature/Regenerator.js');
Add more polyfills
- For junior engineers, you can submit an issue and wait for the maintainer reaction
- For senior engineers, just edit the Polyfill files, and make a pull request
- After your pull request reviewd & merged, the polyfills will be updated by GitHub actions automatically
Host your own mirror
- Fork this repository
- Replace original HTTP domain with yours in GitHub action configuration
- You can replace GitHub pages with an Object Storage service (AWS S3, etc.)
China mainland
Thanks for KaiYuanShe's donation, we get a fast local mirror for China mainland:
Custom examples
Edit .env
content to fit your situation:
WAN_ICON=πΊπ¦
WAN_HOST=https://polyfill.example.ua
LAN_ICON=π·πΊ
LAN_HOST=https://polyfill.example.ru
or
WAN_ICON=π°π·
WAN_HOST=https://polyfill.example.kr
LAN_ICON=π°π΅
LAN_HOST=https://polyfill.example.kp