2.0.1 • Published 5 months ago

ts-module-alias-transformer v2.0.1

Weekly downloads
8
License
MIT
Repository
github
Last release
5 months ago

ts-module-alias-transformer

npm version Build Status

A cli tool uses Babel to rewrite module name from typescript's build result including .d.ts files.

It uses

This command line tool is bundled with all dependencies (including @babel/core). Thus, it doesn't require installing any dependencies and won't pollute the dependency tree in your local project.

Installation

npm install -g ts-module-alias-transformer

Usage

Usage: ts-module-alias-transformer [options] <src> [dst]

A cli tool uses Babel to rewrite module name from typescript's build result including .d.ts files.
  <src>: The source directory / file that contains typescript build result.
  [dst]: Optional. The destination directory / file. If not provided, output will replace the <src>.

Options:
  -V, --version                              output the version number
  -p, --mappingConfigPath <packageJsonPath>  Optional. Specify the mapping config json file location. 
                                             By default, it will read the `_moduleMappings` field of package.json in current working 
                                             directory to determine the module paths to replace. 
                                             See https://github.com/t83714/ts-module-alias-transformer for more details.
  -h, --help                                 output usage information

Configuration

By default, it will read the _moduleMappings field of package.json in current working directory to determine the module paths to replace (unless the switch -p is provided to specify an alternative config file location).

e.g. Here is an example:

{
  "name": "....",
  "version": "1.0.0",
  "description": "...",
  "_moduleMappings": {
      "@a/b/c": "../../a/b/c",
      "@x/y/z": "../d/e/f"
  }
}
2.0.1

5 months ago

2.0.0

5 months ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago