typescript-paths-normalizer

1.0.1 • Public • Published

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://git@gitlab.com/terapio/typescript-paths-normalizer.git -D

Usage

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)

Readme

Keywords

none

Package Sidebar

Install

npm i typescript-paths-normalizer

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

3.03 kB

Total Files

8

Last publish

Collaborators

  • la.stef