0

I'd like to setup tsconfig-paths for this project.

I'm not sure what I need to do after installing tsconfig-paths as a dev dependency.

Thoughts?

Ole
  • 41,793
  • 59
  • 191
  • 359

1 Answers1

0

The plugin has to be registered dynamically via the command line for each script that is run. For example I have a data generate script in test/data/generate/index.ts. In order to run this script, which imports from @fs/utilities I need to do:

npx ts-node -r tsconfig-paths/register test/data/generate/index.ts

For my use cases this is enough as I have few scripts that need to be run dynamically inside the typescript project. For example for @fireflysemantics/validator everything exported is intended to be used by external dependencies, thus there are no cases where I need to run data generation scripts.

Ole
  • 41,793
  • 59
  • 191
  • 359