2 years ago

#54272

test-img

Sh eldeeb

tsconfig.paths not working with ES modules

I switched my project to enable ES modules:

  • added type: module in package.json
  • use node --loader ts-node/esm instead of ts-node
  • changed module: commonjs to esnext

It works fine, except when starting using paths aliases.

so, import test from './file'; works, but import test from '@app/file'; doesn't work

minimal reproducible example

typescript

es6-modules

ts-node

0 Answers

Your Answer

Accepted video resources