typescript-transform-aliases
v0.2.2
Published
Transform aliases in TypeScript files.
Downloads
203
Readme
typescript-transform-aliases
Transform aliases in TypeScript files.
Install
npm i -D typescript-transform-aliases
# or
yarn add -D typescript-transform-aliases
Usage
With ttypescript or ts-patch
{
"compilerOptions": {
"plugins": [
{
"transform": "typescript-transform-aliases",
"after": true,
"afterDeclarations": true,
"aliases": {
// for example
"^lodash-es$": "lodash"
}
}
]
}
}
Similar packages
Both typescript-transform-paths
and @zerollup/ts-transform-paths
transform the paths
field in tsconfig.json
, which are usually aliases for relative paths;
ts-transform-import-path-rewrite
could transform any aliases but does not support require
or dynamic imports.