How Can Typescript Generate Single One Javascript File Without Reference Typescript File Code
Solution 1:
Looks to me that you need to split your compilation into two phases, one to generate soruce1 and soruce2, and another one to generate reference1 and reference2. The best way to do this is to generate a .d.ts from the first batch of files then reference that in your second compilation.
to generate sources.d.ts:
tsc --declaration--out soruces.js soruce1.ts source2.ts
now your files should look like:
///reference path=’sources.d.ts’Classreference1{...};
///reference path=’source.s.ts’Classreference2{...};
the second compilation would be:
tsc --out references.js reference1.ts reference2.ts
Solution 2:
You are asking the compiler to do conflicting things.
If you want a single output file, you use the flag:
tsc --out single.js app.ts
This tells the compiler to walk any dependencies, combine the output in the correct order and save it in single.js
If you don't want a single file, you leave out the flag and each TypeScript file will be paired with its output JavaScript file.
You are asking if you can combine files without including referenced files - that isn't possible.
Post a Comment for "How Can Typescript Generate Single One Javascript File Without Reference Typescript File Code"