We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 15f4b58 + 8279667 commit 3c9a3c5Copy full SHA for 3c9a3c5
src/compiler/utilities.ts
@@ -1435,8 +1435,10 @@ module ts {
1435
1436
export function shouldEmitToOwnFile(sourceFile: SourceFile, compilerOptions: CompilerOptions): boolean {
1437
if (!isDeclarationFile(sourceFile)) {
1438
- if ((isExternalModule(sourceFile) || !compilerOptions.out) && !fileExtensionIs(sourceFile.fileName, ".js")) {
1439
- return true;
+ if ((isExternalModule(sourceFile) || !compilerOptions.out)) {
+ // 1. in-browser single file compilation scenario
1440
+ // 2. non .js file
1441
+ return compilerOptions.separateCompilation || !fileExtensionIs(sourceFile.fileName, ".js");
1442
}
1443
return false;
1444
0 commit comments