Skip to content

Commit

Permalink
fix: parseRoutes bug in multiply fetch files
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyuang committed Jul 24, 2021
1 parent 6a9450a commit 00f9be3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/server-utils/src/parse.ts
Expand Up @@ -191,7 +191,7 @@ const renderRoutes = async (pageDir: string, pathRecord: string[], route: ParseF
}
if (fetchExactMatch.length >= 2) {
// fetch文件数量 >=2 启用完全匹配策略 render$id => fetch$id, render => fetch
const fetchPageFiles = `fetch${pageFiles.replace('render', '').replace('.vue', '.ts')}`
const fetchPageFiles = `fetch${pageFiles.replace('render', '').replace('.vue', '.ts').replace('.tsx', '.ts')}`
if (fetchExactMatch.includes(fetchPageFiles)) {
route.fetch = `${aliasPath}/${fetchPageFiles}`
}
Expand Down

0 comments on commit 00f9be3

Please sign in to comment.