Skip to content

Commit 715a521

Browse files
authored
Parse JS templates as TSX to support JSX syntax (#6756)
1 parent 9da74df commit 715a521

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

rewrite-javascript/rewrite/package-lock.json

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rewrite-javascript/rewrite/src/javascript/templating/engine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class TemplateCache {
150150
relativeTo: workspaceDir,
151151
sourceFileCache: templateSourceFileCache
152152
});
153-
const parseGenerator = parser.parse({text: fullTemplateString, sourcePath: 'template.ts'});
153+
const parseGenerator = parser.parse({text: fullTemplateString, sourcePath: 'template.tsx'});
154154
cu = (await parseGenerator.next()).value as JS.CompilationUnit;
155155

156156
this.cache.set(key, cu);

0 commit comments

Comments
 (0)