Skip to content

Commit 4566bab

Browse files
authored
fix: layout loading priority (#1674)
1 parent 60099f4 commit 4566bab

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/slidev/node/vite/loaders.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,16 @@ export function createSlidesLoader(
9292

9393
const layouts: Record<string, string> = {}
9494

95-
for (const root of [...roots, clientRoot]) {
95+
for (const root of [clientRoot, ...roots]) {
9696
const layoutPaths = await fg('layouts/**/*.{vue,ts}', {
9797
cwd: root,
9898
absolute: true,
9999
suppressErrors: true,
100100
})
101101

102102
for (const layoutPath of layoutPaths) {
103-
const layout = path.basename(layoutPath).replace(/\.\w+$/, '')
104-
if (layouts[layout])
105-
continue
106-
layouts[layout] = layoutPath
103+
const layoutName = path.basename(layoutPath).replace(/\.\w+$/, '')
104+
layouts[layoutName] = layoutPath
107105
}
108106
}
109107

0 commit comments

Comments
 (0)