poly-filler
Generates scripts to html files for link[rel="import"] compatability Originally created to generate the polyfills for WebComponents & specifically for a modernized web-app environment
Note: For more information on WebComponents start here).
Important: If you are already familiar with Web Components make sure you modify the generator to fit your needs.
Use
- Install poly-filler
npm i poly-filler
- Create a configuration
const polyfiller = const POLYFILLER_CONFIG = "root":"path-to-root-for-resource-files" "files": "final-name-of-file-as-key": "path":"path/or-path/for-resource-file.js" "destination":"path-to-destination-root-for-directory" "directory":"output-directory-name";polyfiller // Saved Configpolyfiller // Tests Configpolyfiller // Runs a Config
- Run poly-filler
const polyfiller = polyfiller // => pollyfillerRunner //to save // => Promise.then((res)=>{ console.log(res)}).catch(console.error) //or to check it out // => Promise.then((blocks)=>{ console.log(blocks)})
Help
If you run into problems - keep in mind the package will require permission to create the directory & files. If you dont specify these options - output defaults to the package's "imports" directory.d
Polyfills included only as Guide/Starter Pack
Included Polyfills:
customElement: CustomElementsV1 polyfill for defining/registering custom html elements. Source: package (info)
Shadow DOM: Sourced from webcomponentsjs - provides encapsulation by hiding DOM subtrees under shadow roots (spec).
Proxy: A polyfill for the Proxy
object, part of ES6.
See the MDN docs or Introducing ES2015 Proxies for more information on Proxy
itself. Source:
(package);
fetch: Method for HTTP requests using a Promises (package);
Promise: Required by fetch - For API information about Promises, please check out this article HTML5Rocks article. Source: package