
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
autopolyfiller-loader
Advanced tools
This is like Autoprefixer, but for JavaScript polyfills. It scans your code and applies only required polyfills.
$ npm i -S autopolyfiller-loader
module: {
postLoaders: [ {
test: /\.js$/,
exclude: /\/(node_modules|bower_components)\//,
loader: 'autopolyfiller',
query: {
browsers: [ 'last 2 versions', 'ie >= 9' ], //list of browsers to polyfill
withParser: ['acorn@0.11.0', {ecmaVersion: 6}], //allow use custom parser
parserOptions: {ecmaVersion: 6}, // only if no #withParser specified,
// allow to use custom options with acorn v4 parser
exclude: ['Promise'], //exclude some polyfills
include: ['Object.create'], //force include some polifills
use: [{
// AST tree pattern matching
// It may "grep" multiply polyfills
test: function (ast) {
return query('Object.newFeature(_$)', ast).length > 0 ? ['Object.newFeature'] : [];
},
// Your polyfills code
polyfill: {
'Object.newFeature': 'Object.newFeature = function () {};'
},
// This list means "apply this feature to the <list of browsers>"
// For more examples see https://github.com/jonathantneal/polyfill/blob/master/agent.js.json
support: {
// For chrome 29 only apply Object.newFeature polyfill
'Chrome': [{
only: '29',
fill: 'Object.newFeature'
}]
},
// This is optional. By default autopolyfiller will use
// polyfill's name to generate condition's code:
wrapper: {
'Object.newFeature': {
'before': 'if (!("newFeature" in Object)) {',
'after': '}'
}
}
}] //add custom polyfills
}
} ]
}
FAQs
Autopolyfiller loader for webpack
We found that autopolyfiller-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.