mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
transpile text as tsx if jsx option is specified
This commit is contained in:
1 parent
738b26f065
commit
75af4f70b6
2 files changed
+64
-7
No files matched your search
@@ -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