Skip to content

Commit

Permalink
fix: optimizeDeps.entries with literal-only pattern(s) (#15853)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinjiang authored Feb 21, 2024
1 parent aff54e1 commit 49300b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/vite/src/node/optimizer/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
SPECIAL_QUERY_RE,
} from '../constants'
import {
arraify,
cleanUrl,
createDebugger,
dataUrlRE,
Expand Down Expand Up @@ -239,6 +240,10 @@ function orderedDependencies(deps: Record<string, string>) {
}

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 glob(pattern, {
cwd: config.root,
ignore: [
Expand Down

0 comments on commit 49300b3

Please sign in to comment.