A fast Typescript paths replacer written in Go. ⚡
go-tspath replaces directly Typescript paths aliases into JS files with real paths based on tsconfig.json
, no more runtime replacers.
Screenshot of go-tspath
performing replacements in a Typescript code base project with more than 200 JS files and around 5857 lines of code.
go-tspath was tested replacing custom path aliases in a Typescript medium size project with desired results (shown in screenshot above). But there are some features and more testing cases (community user feedback) to do. So, It can considered as Beta yet. Contributions will be very appreciated.
🚀 Download the latest go-tspath binary for your specific platform at go-tspath/releases.
# 1. Build TS files via tsc
# 2. Replace TS paths
go-tspath -config=./tsconfig.replace.json
# 3. Just run your app
# node main.js
- No support for JSON5 format of
tsconfig.json
. But works using a dedicatedtsconfig.json
file with your custom path aliases. Seesample/tsconfig.replace.json
- Limited
compilerOptions
settings. OnlybaseUrl
,paths
andoutDir
are supported. SeeCompilerOptions struct
. - No support for
tsconfig.json
features likeextends
,exclude
or similar.
See an example at sample
directory.
~> go-tspath --help
Usage of go-tspath:
-config string
Specifies the Typescript configuration file. (default "./tsconfig.json")
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in current work by you, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.
Feel free to send some Pull request or issue.
This work is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
© 2019 Jose Quintana