typescript-paths-normalizer
v1.0.1
Published
Build support tool for the module paths aliases in Typescript.
Downloads
13
Readme
Terap.io Typescript Paths Normalizer
Build support tool for the module paths aliases in Typescript. After the transpilation *.ts? to *.js there are still imports with aliases. This script replaces these aliases with the real paths.
Requirements
Typescript configuration for mudules aliases:
{
"compilerOptions": {
paths: {
...
}
}Instalation
npm i git+ssh://[email protected]/terapio/typescript-paths-normalizer.git -DUsage
Use the normalizer after tsc compilation for fixing modules imports. I.e. @entity/something become ./entity/something.
Package package.json looks like this before usage:
scripts: {
...
"build": "rm -rf /somepath && npx tsc"
...
}and after:
scripts: {
...
"build": "rm -rf /somepath && npx tsc && npx typescript-paths-normalizer"
...
}
``
## Dependency
- replace-in-file (https://www.npmjs.com/package/replace-in-file)