tsc-alias
Replace absolute paths to relative paths after typescript compilation
Last updated a month ago by justkey .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install tsc-alias 
SYNC missed versions from official npm registry.

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:

Option Description Default Value
configFile path to tsconfig.json 'tsconfig.json'
watch Observe file changes false
outDir Run in a folder leaving the "outDir" of the tsconfig.json (relative path to tsconfig) tsconfig.compilerOptions.outDir

Current Tags

  • 1.1.1                                ...           latest (a month ago)

16 Versions

  • 1.1.1                                ...           a month ago
  • 1.1.0                                ...           4 months ago
  • 1.0.11                                ...           5 months ago
  • 1.0.10                                ...           5 months ago
  • 1.0.9                                ...           5 months ago
  • 1.0.8                                ...           5 months ago
  • 1.0.7                                ...           5 months ago
  • 1.0.6                                ...           5 months ago
  • 1.0.5                                ...           5 months ago
  • 1.0.4                                ...           5 months ago
  • 1.0.3                                ...           5 months ago
  • 1.0.2                                ...           5 months ago
  • 1.0.1                                ...           5 months ago
  • 1.0.0                                ...           5 months ago
  • 0.0.8                                ...           5 months ago
  • 0.0.7                                ...           5 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 16
Last Day 0
Last Week 16
Last Month 16
Dependencies (6)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |