babel-plugin-root-import
JSON →A Babel plugin that allows you to use root-based import paths (e.g., `~/foo`) instead of long relative paths (`../../../foo`). The current stable version is v5.4.0, with an active maintenance status (the latest release v6.6.0 came later but the package appears to be maintained). It supports custom prefix and suffix, multiple path mappings, and works with both `import` and `require`. Compared to Webpack's alias feature, this plugin operates at the Babel level, making it useful for tools like `babel-node` and testing environments where Webpack resolve is not available. It requires Babel 7 (or 6 depending on version).
Traffic · last 30 days ↓50% vs prev 7d
total hits 21
actors 7 distinct systems
last hit 2d ago AhrefsBot
top countries 🇺🇸 United States · 🇩🇪 Germany · 🇸🇬 Singapore · 🇬🇧 United Kingdom · 🇨🇦 Canada
Resources
API endpoints
compatibility /v1/registry/babel-7-plugin-root-import/compatibility