An automatic CDN service for Web polyfills, which is based on TypeScript, Node.js & UnPkg.
- 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
<head>
<script src="https://polyfill.web-cell.dev/feature/ResizeObserver.js"></script>
</head>
self.importScripts('https://polyfill.web-cell.dev/feature/Regenerator.js');
- 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
- 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.)
Thanks for KaiYuanShe's donation, we get a fast local mirror for China mainland:
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