Using Paths w/ TypeScript
I'm trying to use TypeScripts Paths to make it easier and cleaner to import modules, although I always get:
Cannot find package '@modules/mongodb' imported from C:\ExampleDirectory
I've tried using node -r tsconfig-paths/register .
, but that doesn't work and it still shows the same error above.
The only thing that did manage to work was using tsx
, but unfortunately that's not supported by Sapphire so no commands, listeners, or interaction handlers loaded.Solution:Jump to solution
Turns out that compiling it then running it with tsx works perfectly fine
```json
"main": "dist/index.js",
"type": "module",
"scripts": {...
2 Replies