Skip to content

Commit b4e7d2c

Browse files
authored
fix: allow .mjs extension for route config file (#13931)
1 parent 800d5ad commit b4e7d2c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/dirty-dolls-pay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-router/dev": patch
3+
---
4+
5+
Allow `.mts` and `.mjs` extensions for route config file

packages/react-router-dev/config/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ function omitRoutes(
914914
};
915915
}
916916

917-
const entryExts = [".js", ".jsx", ".ts", ".tsx"];
917+
const entryExts = [".js", ".jsx", ".ts", ".tsx", ".mjs", ".mts"];
918918

919919
function isEntryFile(entryBasename: string, filename: string) {
920920
return entryExts.some((ext) => filename === `${entryBasename}${ext}`);

0 commit comments

Comments
 (0)