tsconfig-replace-paths icon indicating copy to clipboard operation
tsconfig-replace-paths copied to clipboard

Using this with NX lib imports results in importing TS files instead of JS

Open lexa0303 opened this issue 2 years ago • 1 comments

So I have a project set up using NX, with some libs attached and imported via import smth from @test-app/dto.

And when building it with tsc, and then trying to update imports it is changing imports to .ts files instead of .js.

This is from --verbose run:

import '@test-app/dto' replacing '@test-app/dto' -> '../../../../../../../libs/dto/src/index.ts' referencing libs/dto/src/index.ts
/Users/user/WebstormProjects/test-app/dist-tsc/apps/api/src/controllers/accounting/management-contracts/management-contracts-index/get-management-contracts-index-page.js: replaced 1 paths

Any ideas on how to fix it?

lexa0303 avatar Oct 25 '22 11:10 lexa0303

try add .js to importing @test-app/dto in your source file

vcup avatar Mar 08 '23 07:03 vcup