Skip to content

Commit 178e054

Browse files
committed
fix: 修复Windows下入口文件名称错误
1 parent 3f70212 commit 178e054

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

electron.vite.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const getEntry = () => {
1818
const pageEntry = {}
1919
const entries = fg.globSync('./src/renderer/windows/**/index.html')
2020
entries.forEach((entry) => {
21-
const pathArr = entry.split(sep)
22-
const name = pathArr[pathArr.length - 2]
21+
const match = entry.match(/windows\/([^/]+)\/index\.html$/)
22+
const name = match ? match[1] : undefined
2323
if (name) {
2424
pageEntry[name] = resolve('src/renderer/windows', name, 'index.html')
2525
}

0 commit comments

Comments
 (0)