Skip to content

Commit 44e19ff

Browse files
committed
fix: 判断页面正则
1 parent f2c0358 commit 44e19ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,5 +289,5 @@ function insertComponent(node: any, componentName: string, state: any) {
289289
function defaultJudgePage(filePath: string) {
290290
// 兼容 windows 路径
291291
const formatFilePath = filePath.replace(/\\/g, '/')
292-
return /(package-.+\/)?pages\/.+\/index\.[tj]sx$/.test(formatFilePath)
292+
return /(package-.+\/)?pages\/[A-Za-z0-9-]+\/index\.[tj]sx$/.test(formatFilePath)
293293
}

0 commit comments

Comments
 (0)