babel-plugin-tsconfig-alias-to-relative
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

babel-plugin-tsconfig-alias-to-relative

Overview

npm version npm version

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 npm version

Installation

To install the babel-plugin-tsconfig-alias-to-relative, use your preferred package manager:

npm install -D babel-plugin-tsconfig-alias-to-relative

Or

yarn add babel-plugin-tsconfig-alias-to-relative --dev

Note:

This plugin just only resolve src directory files only. I mean you needed to use conventional rules.

Features

  • Dynamically resolve path to relative path style.

Usage

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"
    // 👆👆👆
    // ...
  ]
}

Contact

If you have any questions, feedback, or need assistance with this package, feel free to reach out:

Package Sidebar

Install

npm i babel-plugin-tsconfig-alias-to-relative

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

9.3 kB

Total Files

7

Last publish

Collaborators

  • safin-ali-7205