{"id":28972544,"url":"https://github.com/ember-cli/babel-plugin-filter-imports","last_synced_at":"2025-06-24T11:06:54.653Z","repository":{"id":33322988,"uuid":"36967730","full_name":"ember-cli/babel-plugin-filter-imports","owner":"ember-cli","description":"A babel transform for filtering out imports","archived":false,"fork":false,"pushed_at":"2023-01-18T03:02:22.000Z","size":1703,"stargazers_count":18,"open_issues_count":19,"forks_count":8,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-05T00:20:00.940Z","etag":null,"topics":["babel-plugin"],"latest_commit_sha":null,"homepage":null,"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/ember-cli.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-06T04:46:49.000Z","updated_at":"2022-08-23T12:07:16.000Z","dependencies_parsed_at":"2023-02-10T13:02:31.535Z","dependency_job_id":null,"html_url":"https://github.com/ember-cli/babel-plugin-filter-imports","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/ember-cli/babel-plugin-filter-imports","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fbabel-plugin-filter-imports","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fbabel-plugin-filter-imports/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fbabel-plugin-filter-imports/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fbabel-plugin-filter-imports/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ember-cli","download_url":"https://codeload.github.com/ember-cli/babel-plugin-filter-imports/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fbabel-plugin-filter-imports/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259759822,"owners_count":22907048,"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":["babel-plugin"],"created_at":"2025-06-24T11:06:53.892Z","updated_at":"2025-06-24T11:06:54.645Z","avatar_url":"https://github.com/ember-cli.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-filter-imports\n\n[![Build Status](https://travis-ci.org/ember-cli/babel-plugin-filter-imports.svg?branch=master)](https://travis-ci.org/ember-cli/babel-plugin-filter-imports)\n[![npm](https://img.shields.io/npm/v/babel-plugin-filter-imports.svg?style=flat)](https://www.npmjs.com/package/babel-plugin-filter-imports)\n\nThis babel plugin is used to removed references to imports within a module. This can be useful for removing debugging statements when doing a production build of your code. It is often used in conjunction with other tools like Uglify that perform dead code elimination.\n\n## Installation\n\n```sh\n$ yarn add --dev babel-plugin-filter-imports\n```\n\n*This plugin is for Babel 7. If you need to support:*\n- *Babel 6 use the [babel6](https://github.com/ember-cli/babel-plugin-filter-imports/tree/babel6) branch*\n- *Babel 5 use the [v0.2.x](https://github.com/ember-cli/babel-plugin-filter-imports/tree/v0.2.x) branch*\n\n\n## Example\n\nGiven the `.babelrc`\n\n```json\n{\n  \"plugins\": [[\"filter-imports\", {\n    \"imports\": {\n      \"debugging-tools\": [ \"warn\" ]\n    }\n  }]]\n}\n```\n\nthe module\n\n```js\nimport { warn } from 'debugging-tools';\n\nfunction join(args, sep) {\n  if (arguments.length \u003e 2) {\n    warn(\"join expects at most 2 arguments\");\n  }\n  return args.join(sep);\n}\n```\n\nwill be transformed to\n\n```js\nfunction join(args, sep) {\n  if (arguments.length \u003e 2) {\n  }\n  return args.join(sep);\n}\n```\n\n## Configuration\n\n- `options[keepImports]` `[Boolean]`: An flag that indicates imports removal from header.\n- `options[imports]` `[Object]`: An object whose keys are names of modules.\n- `options[imports][moduleName]` `[String]`: An array of names of imports from `moduleName` to be removed. You can include `'default'` for default export and `'*'` for a namespace export.\n\n## Upgrade to `1.x`/`2.x`\n\nThere were breaking changes in the plugin configuration, you must update it to work correctly.\n\n##### Before `1.x`\n\n```json\n{\n  \"plugins\": [[\"filter-imports\", {\n    \"debugging-tools\": [ \"warn\" ]\n  }]]\n}\n```\n\n##### After\n\n```json\n{\n  \"plugins\": [[\"filter-imports\", {\n    \"imports\": {\n      \"debugging-tools\": [ \"warn\" ]\n    }\n  }]]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fember-cli%2Fbabel-plugin-filter-imports","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fember-cli%2Fbabel-plugin-filter-imports","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fember-cli%2Fbabel-plugin-filter-imports/lists"}