Skip to content

Latest commit

 

History

History
58 lines (47 loc) · 1.99 KB

File metadata and controls

58 lines (47 loc) · 1.99 KB

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: