{"id":13827327,"url":"https://github.com/deepsweet/autopolyfiller-loader","last_synced_at":"2025-09-23T22:11:20.415Z","repository":{"id":21386805,"uuid":"24704484","full_name":"deepsweet/autopolyfiller-loader","owner":"deepsweet","description":":factory: Autopolyfiller loader for webpack","archived":false,"fork":false,"pushed_at":"2019-05-10T20:36:51.000Z","size":27,"stargazers_count":69,"open_issues_count":2,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-20T02:50:55.424Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepsweet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-02T03:18:19.000Z","updated_at":"2023-04-09T09:39:03.000Z","dependencies_parsed_at":"2022-07-30T04:17:58.391Z","dependency_job_id":null,"html_url":"https://github.com/deepsweet/autopolyfiller-loader","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsweet%2Fautopolyfiller-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsweet%2Fautopolyfiller-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsweet%2Fautopolyfiller-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsweet%2Fautopolyfiller-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepsweet","download_url":"https://codeload.github.com/deepsweet/autopolyfiller-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221669508,"owners_count":16860896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T09:01:54.196Z","updated_at":"2025-09-23T22:11:15.364Z","avatar_url":"https://github.com/deepsweet.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"## [Autopolyfiller](https://github.com/azproduction/autopolyfiller) loader for [webpack](https://webpack.github.io/)\n\n[![npm](http://img.shields.io/npm/v/autopolyfiller-loader.svg?style=flat-square)](https://www.npmjs.org/package/autopolyfiller-loader)\n[![travis](http://img.shields.io/travis/deepsweet/autopolyfiller-loader.svg?style=flat-square)](https://travis-ci.org/deepsweet/autopolyfiller-loader)\n[![climate](http://img.shields.io/codeclimate/github/deepsweet/autopolyfiller-loader.svg?style=flat-square)](https://codeclimate.com/github/deepsweet/autopolyfiller-loader/code)\n[![deps](http://img.shields.io/david/deepsweet/autopolyfiller-loader.svg?style=flat-square)](https://david-dm.org/deepsweet/autopolyfiller-loader)\n[![gratipay](http://img.shields.io/gratipay/deepsweet.svg?style=flat-square)](https://gratipay.com/deepsweet/)\n\n\u003e This is like [Autoprefixer](https://github.com/ai/autoprefixer), but for JavaScript polyfills. It scans your code and applies only required polyfills.\n\n### Install\n\n```sh\n$ npm i -S autopolyfiller-loader\n```\n\n### Usage\n\n```js\nmodule: {\n    rules: [ {\n        enforce: 'post',\n        test: /\\.js$/,\n        exclude: /\\/(node_modules|bower_components)\\//,\n        loader: 'autopolyfiller-loader',\n        query: {\n          browsers: [ 'last 2 versions', 'ie \u003e= 9' ], //list of browsers to polyfill\n          withParser: ['acorn@0.11.0', {ecmaVersion: 6}], //allow use custom parser\n          parserOptions: {ecmaVersion: 6}, // only if no #withParser specified,\n                                           // allow to use custom options with acorn v4 parser \n          exclude: ['Promise'], //exclude some polyfills\n          include: ['Object.create'], //force include some polifills\n          use: [{\n                    // AST tree pattern matching\n                    // It may \"grep\" multiply polyfills\n                    test: function (ast) {\n                        return query('Object.newFeature(_$)', ast).length \u003e 0 ? ['Object.newFeature'] : [];\n                    },\n\n                    // Your polyfills code\n                    polyfill: {\n                        'Object.newFeature': 'Object.newFeature = function () {};'\n                    },\n\n                    // This list means \"apply this feature to the \u003clist of browsers\u003e\"\n                    // For more examples see https://github.com/jonathantneal/polyfill/blob/master/agent.js.json\n                    support: {\n                        // For chrome 29 only apply Object.newFeature polyfill\n                        'Chrome': [{\n                            only: '29',\n                            fill: 'Object.newFeature'\n                        }]\n                    },\n\n                    // This is optional. By default autopolyfiller will use\n                    // polyfill's name to generate condition's code:\n                    wrapper: {\n                        'Object.newFeature': {\n                            'before': 'if (!(\"newFeature\" in Object)) {',\n                            'after': '}'\n                        }\n                    }\n                }] //add custom polyfills\n        }\n    } ]\n}\n```\n\n[Documentation: Using loaders](https://webpack.github.io/docs/using-loaders.html).\n\n### License\n[WTFPL](http://www.wtfpl.net/wp-content/uploads/2012/12/wtfpl-strip.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepsweet%2Fautopolyfiller-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepsweet%2Fautopolyfiller-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepsweet%2Fautopolyfiller-loader/lists"}