Open asterius1 opened 3 years ago
That does sound right. I wasn’t a huge TS user when I wrote Elder.js and all of my projects use JS currently.
For a while we checked the dist folder defined in the tsconfig when files weren’t found but that support got dropped pre 1.0 IIRC.
I’d love to have support for this but can’t commit to developing it myself. This should be a relatively straight forward PR though. Simply check the tsconfig for the distdir and update the appropriate fields in getConfig.ts
.
Happy to review a PR for this if you or someone else wants to tackle it.
Today I was chatting with @orta from the TS team about how to implement this.
He recommended looking into using esbuild
in memory transpiling and just evaluating the resulting code whenever a ts
file is imported.
I usually write all my projects in typescript and indeed elderjs has nice support for typescipt in most cases, but I can't make it work to write elderjs routes in typescript. Changing
routes.js
toroutes.ts
makes it so elderjs doesn't see this route file.From what i've seen in elderjs code all references to finding routes have hardcoded
*.js
extensions without mention of*.ts
option.Does it mean there is no way to write elderjs project in 100% typescript?