Skip to content

Commit

Permalink
feat: support .md (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
goisaki authored Jun 8, 2024
1 parent ec0536a commit f9fbe4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/server/utils/file.ts
Original file line number Diff line number Diff line change
@@ -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}.+\]/, '*')
Expand Down
4 changes: 2 additions & 2 deletions src/server/with-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export const createApp = <E extends Env>(options?: ServerOptions<E>) => {
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,
Expand Down

0 comments on commit f9fbe4f

Please sign in to comment.