Here is my current configuration:
tsconfig.json
{
"compileOnSave": true,
"compilerOptions": {
"module": "none",
"outFile": "js/app.js"
}
}
MyApp.Main.ts
class Main
{
constructor()
{
Utilities.init(this);
}
// Other methods
}
MyApp.Utilities.ts
class Utilities
{
static init(app: Main)
{
// Do something with app...
}
// Other methods
}
After saving or recompiling the project, I notice that only separate files are generated for MyApp.Main.js
and MyApp.Utilities.js
, but not for app.js
as specified in the outFile
option.
I have also experimented with adding /// <reference ... />
paths to my "Main" class, but it did not result in combined outputs either.
A few things to consider:
- I must maintain compatibility with IE and cannot target a newer ES version without a shim.
- Introducing a module system is not an option due to project constraints, so the module has to be set as "none".
- Using additional compilers like Babel is also not feasible at the moment.
In essence, I am looking for a solution using pure TypeScript, no module system, and retaining the (default) ES target. Any insights on why the outputs are not being merged into a single .js file?