You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript doesn't emit JS modules when using compiler API (allowJs is enabled):
Code
functionwriteFile(fileName: string,data: string,writeByteOrderMark: boolean){outputFiles.push({sourceName: fileName,name: fileName,writeByteOrderMark: writeByteOrderMark,text: data});}letsource=program.getSourceFile(fileName);/* source is defined and it is a valid js module see getSourceFiles() output below*/letemitResult=program.emit(source,writeFile);/* { emitSkipped: true, diagnostics: [], sourceMaps: [] } */
JS module source
/** * Sum * @param {number} a * @param {number} b * @return {number} */functionsum(a,b){returna+b;}classTest{mod(){}}sum('test',1);
TypeScript Version:
nightly@1.9.0-dev.20160303
Problem
TypeScript doesn't emit JS modules when using compiler API (
allowJs
is enabled):Code
JS module source
getSourceFiles()
Output
Expected behavior:
emitResult.emitSkipped == false
Actual behavior:
emitResult.emitSkipped == true
The text was updated successfully, but these errors were encountered: