A small wrapper around polyfill-service which allows automatic user-agent based polyfills to be sent with Rill.
npm install @rill/polyfillconst app = require('rill')()
const polyfill = require('@rill/polyfill')
// Setup route to send the polyfill.
app.get('/polyfill.js.min', polyfill({ minify: true }))<script src="/polyfill.js.min"></script>{
// The cache time for the polyfill file (string or number of seconds).
maxage: '1 year',
// Enable or disable minification.
minify: true,
// Enable or disable polyfilling unknown user agents.
unknown: true,
// Array of excluded features.
excludes: undefined,
// Object containing the features to pollyfill (defaults to all).
features: undefined
}For a list of polyfills and more documentation click here
- Use
npm testto run tests.
Please feel free to create a PR!