From 1dccc3713a383ac274a36dfcaabcaaa88e380bd1 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Wed, 28 Feb 2024 17:13:24 +0800 Subject: [PATCH] fix: normalize literal-only entry pattern (#16010) --- packages/vite/src/node/optimizer/scan.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/node/optimizer/scan.ts b/packages/vite/src/node/optimizer/scan.ts index 48b816bd23c81d..bcf6fd92c7e662 100644 --- a/packages/vite/src/node/optimizer/scan.ts +++ b/packages/vite/src/node/optimizer/scan.ts @@ -259,7 +259,9 @@ function orderedDependencies(deps: Record) { function globEntries(pattern: string | string[], config: ResolvedConfig) { const resolvedPatterns = arraify(pattern) if (resolvedPatterns.every((str) => !glob.isDynamicPattern(str))) { - return resolvedPatterns.map((p) => path.resolve(config.root, p)) + return resolvedPatterns.map((p) => + normalizePath(path.resolve(config.root, p)), + ) } return glob(pattern, { cwd: config.root,