From 774de59de88a1b82192026ffe1d8eb663ff841c3 Mon Sep 17 00:00:00 2001 From: Kengo Watanabe Date: Sun, 9 Jun 2024 08:00:39 +0900 Subject: [PATCH] feat: support `.md` --- src/server/utils/file.ts | 2 +- src/server/with-defaults.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/utils/file.ts b/src/server/utils/file.ts index c2a21de..5f264e6 100644 --- a/src/server/utils/file.ts +++ b/src/server/utils/file.ts @@ -1,7 +1,7 @@ export const filePathToPath = (filePath: string) => { filePath = filePath .replace(/\.tsx?$/g, '') - .replace(/\.mdx$/g, '') + .replace(/\.mdx?$/g, '') .replace(/^\/?index$/, '/') // `/index` .replace(/\/index$/, '') // `/about/index` .replace(/\[\.{3}.+\]/, '*') diff --git a/src/server/with-defaults.ts b/src/server/with-defaults.ts index 9a94271..5481cf8 100644 --- a/src/server/with-defaults.ts +++ b/src/server/with-defaults.ts @@ -32,8 +32,8 @@ export const createApp = (options?: ServerOptions) => { options?.ROUTES ?? import.meta.glob( [ - '/app/routes/**/!(_*|*.test|*.spec).(ts|tsx|mdx)', - '/app/routes/.well-known/!(_*|*.test|*.spec).(ts|tsx|mdx)', + '/app/routes/**/!(_*|*.test|*.spec).(ts|tsx|md|mdx)', + '/app/routes/.well-known/!(_*|*.test|*.spec).(ts|tsx|md|mdx)', ], { eager: true,