
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
babel-plugin-no-index-imports
Advanced tools
This plugin can transform index imports into direct file imports.
This plugin can transform index imports into direct file imports.
For example, the plugin can transform imports such as
import { Homepage } from '@components';
Into either default style or named imports targeting a specific file.
import { Homepage } from '@components/Homepage';
This can/will improve tree-shaking and reduce bundle size.
yarn add -D babel-plugin-no-index-imports
Add following config in your .babelrc
{
"plugins": [
["babel-plugin-no-index-imports", {
"extensions": ["js", "jsx", "ts", "tsx"],
"useDefaultImport": false,
"stripFileExtension": true,
"extractName": function(filename) {
return filename.substr(0, filename.lastIndexOf('.'));
},
"selectImport": function(importName, imports, member) {
return imports[0];
},
"prefixes": {
"@components": "./src/workspaces",
"@utils": "./src/utils"
}
}]
]
}
v1.1.0
extractName
functionFAQs
This plugin can transform index imports into direct file imports.
The npm package babel-plugin-no-index-imports receives a total of 43 weekly downloads. As such, babel-plugin-no-index-imports popularity was classified as not popular.
We found that babel-plugin-no-index-imports demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.