Vite optimizeDeps.include Glob Pattern Support and Precedence with exclude
0 reputation · 01 Jun 2020, 12:01 UTC
When configuring Vite's dependency pre‑bundling, I want to use a glob pattern such as lodash-* in optimizeDeps.include to automatically pre‑bundle all lodash submodules without listing each one individually. However, the documentation states that optimizeDeps.include accepts only exact package name strings and does not interpret glob patterns, and it does not specify whether inclusions are processed before exclusions when both optimizeDeps.include and optimizeDeps.exclude are present. This leaves the effective set of pre‑bundled dependencies unclear.
- Does Vite treat a value like
lodash-*as a literal package name or ignore it during dependency scanning? - If both
optimizeDeps.includeandoptimizeDeps.excludeare defined, which operation is applied first to determine the final list? - Are there any supported configuration approaches to achieve glob‑like inclusion without resorting to custom plugins?