/ts-transformer-append-js-extension

A TypeScript transformer for use with ts-patch that will append the JS extension to all relative imports that have no extension.

Primary LanguageTypeScriptThe UnlicenseUnlicense

Commitizen friendly Build

Eliminates a need for specifying .js extension for relative imports of TypeScript files.

Based on typescript-transformer-append-js-extension package by @Zoltu, now using ts-patch for transformer capability.

Installation

Install using npm:

npm i -D @aliser/ts-transformer-append-js-extension

Usage

  1. Install ts-patch using the instruction from here.
  2. Add the transformer to tsconfig.json:
{
  "compilerOptions": {
    "plugins": [
      { "transform": "@aliser/ts-transformer-append-js-extension" }
    ]
  },
}
  1. Build your project using tsc or run it using ts-node.