babel-plugin-relativify-imports
Babel plugin to convert absolute import paths to relative paths.
Example, given this code in /src/folder/module.js
:
{ const submodule2 = await import'/src/folder/subfolder/submodule2.js' submodule2method}
Will become:
{ const submodule2 = await import'./subfolder/submodule2.js' submodule2method}
Note: to convert bare module imports (import { Module } from '@organization/module'
), please use cfware/babel-plugin-bare-import-rewrite before this plugin in your babel plugin chain.
Usage
Add to your project:
npm install babel-plugin-relativify-imports
Add relativify-imports
to plugins
in your babel settings:
Contributing
Install
npm install
Test
npm test