I am currently facing issues with separating my TypeScript classes into distinct files using internal modules. Unfortunately, the main.ts file is not loading or recognizing the sub-modules.
main.ts
/// <reference path="Car.ts" />
module Vehicles {
var c = new Vehicles.Car("red");
}
car.ts
module Vehicles {
export class Car {
color: string;
constructor(color: string) {
this.color = color;
console.log("created a new " + color + " car");
}
}
}
tsconfig.json
{
"compilerOptions": {
"sourceMap": true,
"out": "everything.js main.ts car.ts"
}
}
Update: I made an adjustment to the "out" flag in tsconfig in an attempt to compile main.ts and car.ts into everything.js - unfortunately, this last step is not functioning correctly as everything.js is not being created. Instead, VS Code generates a main.js and a car.js. It appears that the "out" flag is not being recognized. I also tried using "outFile" but encountered the same result.