Folders not initialized when building with Typescript
Hello,
I don't know if I missed out something in my
tsconfig
tsconfig
or node config but I tried making Listeners/Commands with Sapphire but after building with
npx tsc
npx tsc
and running it with node or bun the only thing that is recognized and initialized is the main
index.js
index.js
file (even tough tsc transpiled every files in the project dir correctly).
The bot is logging in correctly and is working normally if I write it in common esm, transpiled esm or ts but when using ts with bun build or tsc with node it doesn't initialize my sub folders classes (the listeners and commands).
I followed the official documentation for starting my project without using the cli btw. I have a ./src/index.ts with a ./src/listeners/ready.ts.
I tried adding the sapphire ts config but it hasn't had any effects.
The pic is what combination worked/didn't worked.
Can you help me find my mistake? Thanks.
Solution
So, I tried and I can say that for now the bun builder (that is in beta) cannot recreate the correct structure of the project because it doesn't see the relationship between the two files (index.ts ready.ts) from its entrypoint (index.ts) as stated in the documentation and thats why I can't see my listeners or commands being initialized. Three options: - the first one is to use tsc to build the structure - and the second one is to not transpile my code and run the ts files directly. - the last one is to build each files separately using the --splitting option.