Fix default behavior for transpileModule when fileName not provided (#32982)

This commit is contained in:
Ron Buckton
2019-08-19 18:13:39 -07:00
committed by GitHub
parent 6ca9d04b60
commit 1bf218291f
4 changed files with 17 additions and 4 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ namespace ts {
options.noResolve = true;
// if jsx is specified then treat file as .tsx
const inputFileName = transpileOptions.fileName || (options.jsx ? "module.tsx" : "module.ts");
const inputFileName = transpileOptions.fileName || (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx ? "module.tsx" : "module.ts");
const sourceFile = createSourceFile(inputFileName, input, options.target!); // TODO: GH#18217
if (transpileOptions.moduleName) {
sourceFile.moduleName = transpileOptions.moduleName;