mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 20:51:43 -06:00
emit input non .ts files as separate files when 'allowNonTsExtensions' and 'separateCompilation' flags are specified (used in 'transpile' related scenarios)
This commit is contained in:
parent
282c1d2139
commit
60f3fe3de2
@ -1435,8 +1435,11 @@ module ts {
|
||||
|
||||
export function shouldEmitToOwnFile(sourceFile: SourceFile, compilerOptions: CompilerOptions): boolean {
|
||||
if (!isDeclarationFile(sourceFile)) {
|
||||
if ((isExternalModule(sourceFile) || !compilerOptions.out) && !fileExtensionIs(sourceFile.fileName, ".js")) {
|
||||
return true;
|
||||
if ((isExternalModule(sourceFile) || !compilerOptions.out)) {
|
||||
// 1. in-browser single file compilation scenario
|
||||
// 2. non .js file
|
||||
return (compilerOptions.separateCompilation && compilerOptions.allowNonTsExtensions) ||
|
||||
!fileExtensionIs(sourceFile.fileName, ".js");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user