Skip to content

Commit 67b40b1

Browse files
authored
fix: use slash utility for relative globs (#2389)
1 parent 7a8704e commit 67b40b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/slidev/node/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type MarkdownIt from 'markdown-it'
33
import type { Connect, GeneralImportGlobOptions } from 'vite'
44
import { relative } from 'node:path'
55
import { fileURLToPath } from 'node:url'
6+
import { slash } from '@antfu/utils'
67
import { createJiti } from 'jiti'
78
import YAML from 'yaml'
89

@@ -105,7 +106,7 @@ export function makeAbsoluteImportGlob(
105106
options: Partial<GeneralImportGlobOptions> = {},
106107
) {
107108
// Vite's import.meta.glob only supports relative paths
108-
const relativeGlobs = globs.map(glob => `./${relative(userRoot, glob)}`)
109+
const relativeGlobs = globs.map(glob => `./${slash(relative(userRoot, glob))}`)
109110
const opts: GeneralImportGlobOptions = {
110111
eager: true,
111112
exhaustive: true,

0 commit comments

Comments
 (0)