1.2.0 • Published 3 years ago

@l3v1k/tsc-alias v1.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

tsc-alias

Replace absolute paths to relative paths after typescript compilation (tsc) during compile-time. You can add aliases that reference other projects outside your tsconfig.json project by providing a relative path to the baseUrl.

npm version Dependency Status License

Comparison to tsconfig-paths

+ Compile time (no runtime dependencies)

Getting Started

First, install tsc-alias as devDependency using npm.

npm install -g tsc-alias
npm install --save-dev tsc-alias

Add it to your build scripts in package.json

"scripts": {
  "build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json",
}

================ OR ===================

"scripts": {
  "build": "tsc && tsc-alias",
  "build:watch": "tsc -w && tsc-alias -w"
}

API

Installation

npm install tsc-alias

Usage

import { replaceTscAliasPaths } from 'tsc-alias';

replaceTscAliasPaths(options?);

Here are all the available options: