Babel plugin (v2.0.1) that transforms project-relative import paths (e.g., '~') into file-relative paths during build. Unlike alternatives like babel-root-import that convert to absolute paths, this plugin produces relative output for portability across systems. Tested with babel-cli, webpack, and task runners. Last release appears stable, but the project is in maintenance mode with infrequent updates.
npm install babel-project-relative-importVerified import paths — ran on the pinned version, not inferred.
Shows installation, Babel config, and transformation of a project-relative import.
Rename option to `sourceDir` in Babel config.
If you need a slash, include it in the prefix value (e.g., '^/').
Consider using Webpack's resolve.alias for similar behavior without Babel transform.
Ensure your project-relative imports use the configured prefix (default: '~/').
Consider migrating to modern alternatives like babel-plugin-module-resolver.
Run `npm install babel-project-relative-import --save-dev` and check .babelrc for correct spelling.
Rename option to "sourceDir" in plugin configuration.
Set sourceDir to project subdirectory (e.g., "src/") so the plugin can compute correct relative path.
If prefix is '^', use '^/dir/file' or change prefix to '^/'.
Ensure Babel config normalizes paths or use a post-transform step.
No dependency data recorded yet.