@xascode/tscpaths
v0.1.4
Published
Replace absolute paths to relative paths after typescript compilation
Downloads
641
Maintainers
Readme
This is a fork of herbcaudill/tscpaths which is a fork of joonhocho/tscpaths.
tscpaths
Replace absolute paths to relative paths after typescript compilation (tsc) during compile-time.
Comparison to tsconfig-paths
+ Compile time (no runtime dependencies)
Getting Started
First, install tscpaths as devDependency using npm or yarn.
npm install --save-dev @XasCode/tscpaths
# or
yarn add -D @XasCode/tscpaths
Add it to your postbuild script in package.json
"scripts": {
"build": "tsc --project tsconfig.json",
"postbuild": "tscpaths -p tsconfig.json -s ./src -o ./out --silent",
}
Options
| flag | description | | ------------ | -------------------------------------------------- | | -p --project | project configuration file (tsconfig.json) | | -s --src | source code root directory | | -o --out | output directory of transpiled code (tsc --outDir) | | --silent | silence the console output |
You need to provide -s (--src) and -o (--out), because it's hard to predict source and output paths based on tsconfig.json.