mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-29 22:02:46 -07:00
Revert "fix: catch-all server side handler"
This reverts commit 7e8be92cd5.
This commit is contained in:
@@ -85,7 +85,8 @@ async function getRouteNodes(
|
||||
} else if (fullPath.match(/\.(rs)$/)) {
|
||||
const filePath = replaceBackslash(path.join(dir, dirent.name))
|
||||
const filePathNoExt = removeExt(filePath)
|
||||
let routePath = cleanPath(`/${filePathNoExt}`) || ''
|
||||
let routePath =
|
||||
cleanPath(`/${filePathNoExt.split('.').join('/')}`) || ''
|
||||
|
||||
if (routePath === 'index') {
|
||||
routePath = '/'
|
||||
@@ -166,16 +167,17 @@ export async function routeGenerator(config = defaultConfig): Promise<void> {
|
||||
const imports = [
|
||||
...sortedRouteNodes.map((node) => {
|
||||
const extension = node.filePath.endsWith('mdx') ? '.mdx' : ''
|
||||
return `const ${node.variableName as string
|
||||
}Import = dynamic(() => import('./${replaceBackslash(
|
||||
removeExt(
|
||||
path.relative(
|
||||
path.dirname(config.generatedRouteTree),
|
||||
path.resolve(config.folderName, node.filePath),
|
||||
),
|
||||
false,
|
||||
return `const ${
|
||||
node.variableName as string
|
||||
}Import = dynamic(() => import('./${replaceBackslash(
|
||||
removeExt(
|
||||
path.relative(
|
||||
path.dirname(config.generatedRouteTree),
|
||||
path.resolve(config.folderName, node.filePath),
|
||||
),
|
||||
)}${extension}'))`
|
||||
false,
|
||||
),
|
||||
)}${extension}'))`
|
||||
}),
|
||||
].join('\n')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user