0.2.2 • Published 1 year ago

typescript-transform-aliases v0.2.2

Weekly downloads
3
License
ISC
Repository
github
Last release
1 year ago

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.