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.
Install using npm
:
npm i -D @aliser/ts-transformer-append-js-extension
- Install
ts-patch
using the instruction from here. - Add the transformer to
tsconfig.json
:
{
"compilerOptions": {
"plugins": [
{ "transform": "@aliser/ts-transformer-append-js-extension" }
]
},
}
- Build your project using
tsc
or run it usingts-node
.