This tutorial hasn't been translated.
This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.
This tutorial on using TypeScript in Construct has been moved to the official manual, in the 'Scripting' section's guides. You can now find the latest documentation here: https://www.construct.net/en/make-games/manuals/construct-3/scripting/guides/using-typescript
Is it possible to make Construct to allow me to write imports like:
import Globals from "./globals"
instead of:
import Globals from "./globals.js";
without .js at the end.
When I'm working on TypeScript projects all imports usually omit file extension. This is a bit anoying to manualy change it all the time. I'll see if I can configure my IDE to add .js at the end. But I've been working more than 5 years with TypeScript and never ever I've added any extensions in the imports. Also IDE auto insert imports, and they don't have extensions
TypeScript needs to generate JavaScript that refers to a filename like "./globals.js", because that's how it works in the browser. You can configure TypeScript however you like, so long as it outputs that. I think I saw that TypeScript 5.7 is going to be adding some new options around this.
this should be added to the manual under guides in scripting section. I missed this the first time I checked as its a hidden link the manual.
I think it is indeed better off in the main manual - it's now moved to here.