mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
transpile text as tsx if jsx option is specified
This commit is contained in:
@@ -1850,8 +1850,8 @@ namespace ts {
|
||||
// so pass --noResolve to avoid reporting missing file errors.
|
||||
options.noResolve = true;
|
||||
|
||||
// Parse
|
||||
let inputFileName = transpileOptions.fileName || "module.ts";
|
||||
// if jsx is specified then treat file as .tsx
|
||||
let inputFileName = transpileOptions.fileName || (options.jsx ? "module.tsx" : "module.ts");
|
||||
let sourceFile = createSourceFile(inputFileName, input, options.target);
|
||||
if (transpileOptions.moduleName) {
|
||||
sourceFile.moduleName = transpileOptions.moduleName;
|
||||
|
||||
Reference in New Issue
Block a user