# entwicklerstube/babel-plugin-root-import

Add the opportunity to import modules by the root path

Repository: https://github.com/entwicklerstube/babel-plugin-root-import
Canonical: https://ross.abutalabs.com/products/babel-plugin-root-import
Homepage: https://npmjs.com/babel-plugin-root-import
Language: JavaScript
License: MIT
License Family: permissive
Topics: babel, babel-plugin, es6, tdd
Last push: 2022-12-03T02:37:48+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4044, "days_push": 1370, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1169, forks 74 (observed 2026-08-28T04:03:51.102839+00:00)

## What it is
A Babel plugin that lets you import and require modules using root-based paths (like ~/some/file.js) instead of long relative paths. It rewrites these paths at build time and supports configurable prefixes and multiple path rules.

## Use cases
- avoid ../../../ relative import chains in JavaScript projects
- configure custom import aliases like ~/ for src directory
- use root-based imports in React Native with Babel
- support multiple path prefixes for different source folders
- make imports resilient to file moves in a Babel-based build

## When to choose
- your project already uses Babel and you want root-based imports without a bundler alias
- you need multiple custom prefixes mapped to different directories
- you are on React Native where Babel config is the main place to set path aliases

## When to avoid
- your bundler (webpack, Vite, TypeScript paths) already resolves aliases without Babel
- you are not using Babel in your build pipeline
- you need a maintained solution - the last release was 2022

## Facets
- artifact type: plugin
- maturity: maintenance
- function: build-tool, developer-tools
- domain: developer-tools, web-development, frontend
- platform: -
- tags: babel-plugin, module-resolution, import-paths, es6-modules, nodejs, javascript

## Member repositories
- entwicklerstube/babel-plugin-root-import (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:51.102839+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:28:41.424761+00:00, confidence not recorded.
  - readme: https://github.com/entwicklerstube/babel-plugin-root-import (fetched 2026-08-28T04:03:51.102839+00:00, sha 34a42ed7fe5f)
  - registry_npm: https://registry.npmjs.org/babel-plugin-root-import (fetched 2026-08-29T12:34:36.487860+00:00, sha bd2e8e079aa5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
