Reputation: 593
I have a typescript module split over two files in Webstorm. I want to compile it into a single javascript file. However, when it is compiled, only one or the other typescript file has been compiled (it is not merging them, and probably overwriting one with the other). I will only see the methods from aClass OR bClass but not both. What settings are required to get the typescript module over 2 files merged and compiled into a single file?
Under Languages and Frameworks I have the following settings:
Command line options: --module amd --sourcemap $FileName$ --out script.js
Use output path: /public/Script
My typescript files are:
aClass.ts
module aModule{
export class aClass implements IInterface{
//Some methods
}
}
bClass.ts
module aModule{
export class bClass implements IInterface{
//Some methods
}
}
IInterface.ts
module aModule {
export interface IInterface {
}
}
Upvotes: 0
Views: 729
Reputation: 8136
Just set 'Compile main file' option and specify a file name in the 'Output path' field + you need to specify in /// all referenced files.
The second way is to use 'tsconfig.json' as was suggested.
Upvotes: 1
Reputation: 276171
--module amd --sourcemap $FileName$ --out script.js
You cannot use --module
and --out
together. The compiler should error but it doesn't.
Upvotes: 2