This Babel plugin is designed to automatically resolve TypeScript's tsconfig.json path aliases using relative paths. It simplifies the development process by allowing you to use aliases in your import statements without worrying about the file's location.
| dependency | weekly downloads |
|---|---|
| json-to-js-obj |
To install the babel-plugin-tsconfig-alias-to-relative, use your preferred package manager:
npm install -D babel-plugin-tsconfig-alias-to-relativeOr
yarn add babel-plugin-tsconfig-alias-to-relative --devThis plugin just only resolve src directory files only. I mean you needed to use conventional rules.
- Dynamically resolve path to
relative pathstyle.
you must to be specified in babel config file
{
"presets": [
// ...
"@babel/preset-typescript",
// ...
],
"plugins": [
// add this to your babel config file in `plugins`
// 👇👇👇
"tsconfig-alias-to-relative"
// 👆👆👆
// ...
]
}If you have any questions, feedback, or need assistance with this package, feel free to reach out:
- Author: Safin Ali
- Email: [email protected]
- GitHub: github.com/Safin-Ali
- Website: https://safin-ali.vercel.app