npm.io
0.2.3 • Published 1 year ago

typescript-transform-aliases

Licence
ISC
Version
0.2.3
Deps
0
Size
8 kB
Vulns
0
Weekly
0
Stars
2

typescript-transform-aliases

npm

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.

Keywords