Skip to content

Commit

Permalink
Support more JS extensions in syntax-parser (#10615)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist authored Aug 16, 2024
1 parent b659cdb commit 7142c55
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/replay-next/src/utils/syntax-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,17 @@ function urlToLanguage(fileName: string): LRLanguage {
const extension = fileName.split(".").pop()!.split("?").shift()!;
switch (extension) {
case "js":
case "mjs":
case "cjs":
return javascriptLanguage;
case "jsx":
return jsxLanguage;
case "ts":
return typescriptLanguage;
case "tsx":
// .mts and .cts follow .tsx parsing rules (they don't support angle bracket casting and they allow JSX)
case "mts":
case "cts":
return tsxLanguage;
case "json":
return jsonLanguage;
Expand Down

0 comments on commit 7142c55

Please sign in to comment.