I have use @/ as Root
I have used @/ as root but now it doesnt finds the modules I'm not sure how to fix that anyone that can help me out?

Solution:Jump to solution
setting it in only tsconfig isnt enough. Ts doesnt recompute paths when compiling. Either use NodeJS built in submodule imports and switch to
#
instead of @
in the process, or use something like the module-alias package.7 Replies
Solution
setting it in only tsconfig isnt enough. Ts doesnt recompute paths when compiling. Either use NodeJS built in submodule imports and switch to
#
instead of @
in the process, or use something like the module-alias package.TSConfig Reference - Docs on every TSConfig option
From allowJs to useDefineForClassFields the TSConfig reference includes information about all of the active compiler flags setting up a TypeScript project.
there is any youtube tutorial that already have done it on spphirejs or something?
No idea. Written guides and documentation are far more valuable for programming anyway as they are less likely to be heavily opinionated and or outdated.
Many bots from the following list use it though:
Discord Bots using @sapphire/framework
v5.x
- Gemboard ᴱ ᴰ
- Skyra ᴱ ᴬ ᴰ
- Dragonite ᴱ ᴰ
- Archangel ᴱ ᴰ
- Official Bot Examples ᴱ ᴰ ᴶˢ
- KBot ᴱ ᴬ ᴰ
- Perpetual Mechanical Array ᴰ
- Birthdayy ᴰ
- Sapphire Application Commands Examples ᴱ
Legend for the identifiers
ᴱ: Uses ESM (if not specified then uses CJS)
ᴬ: Advanced bot (if not specified it is a simple bot, or not graded)
ᴰ: Uses Docker in production
ᴶˢ: Written in JavaScript. If not specified then the bot is written in TypeScript.
tsc-alias is also pretty good, and requires no configuration. It is pretty good at figuring out things on its own
I can see the advantages yes but I would recommend using the NodeJS solution still as there are also runtime advantages of having shorter and aliased paths (minor speed improvements in path resolutions) and you can only achieve that with the NodeJS built in method.