Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
babel-plugin-filter-imports
Advanced tools
This plugin is for Babel 6. If you need to support Babel 5 use the v0.2.x branch.
This 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.
Given the .babelrc
{
"plugins": [["filter-imports", {
"imports": {
"debugging-tools": [ "warn" ]
}
}]]
}
the module
import { warn } from 'debugging-tools';
function join(args, sep) {
if (arguments.length > 2) {
warn("join expects at most 2 arguments");
}
return args.join(sep);
}
will be transformed to
function join(args, sep) {
if (arguments.length > 2) {
}
return args.join(sep);
}
options[keepImports]
[Boolean]
: An flag that indicates imports removal from header.options[imports]
[Object]
: An object whose keys are names of modules.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.1.x
There were breaking changes in the plugin configuration, you must update it to work correctly.
1.x
{
"plugins": [["filter-imports", {
"debugging-tools": [ "warn" ]
}]]
}
{
"plugins": [["filter-imports", {
"imports": {
"debugging-tools": [ "warn" ]
}
}]]
}
v1.1.2 (2018-04-30)
Closed issues:
Merged pull requests:
FAQs
A babel transform for filtering out imports
The npm package babel-plugin-filter-imports receives a total of 108,551 weekly downloads. As such, babel-plugin-filter-imports popularity was classified as popular.
We found that babel-plugin-filter-imports demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.