Optional ExperimentaldisabledOptionalesbuildOptions to pass to esbuild during the dep scanning and optimization
Certain options are omitted since changing them would not be compatible with Vite's dep optimization.
external is also omitted, use Vite's optimizeDeps.exclude optionplugins are merged with Vite's dep pluginOptionalexcludeDo not optimize these dependencies (must be resolvable import paths, cannot be globs).
Optional ExperimentalextensionsList of file extensions that can be optimized. A corresponding esbuild plugin must exist to handle the specific extension.
By default, Vite can optimize .mjs, .js, .ts, and .mts files. This option
allows specifying additional extensions.
Optional ExperimentalholdWhen enabled, it will hold the first optimized deps results until all static
imports are crawled on cold start. This avoids the need for full-page reloads
when new dependencies are discovered and they trigger the generation of new
common chunks. If all dependencies are found by the scanner plus the explicitly
defined ones in include, it is better to disable this option to let the
browser process more requests in parallel.
Optional ExperimentalignoreWhen enabled, Vite will not throw an error when an outdated optimized dependency is requested. Enabling this option may cause a single module to have a multiple reference.
OptionalincludeForce optimize listed dependencies (must be resolvable import paths, cannot be globs).
Optional ExperimentalneedsForces ESM interop when importing these dependencies. Some legacy
packages advertise themselves as ESM but use require internally
OptionalnoAutomatic dependency discovery. When noDiscovery is true, only dependencies
listed in include will be optimized. The scanner isn't run for cold start
in this case. CJS-only dependencies must be present in include during dev.
Deps optimization during build was removed in Vite 5.1. This option is now redundant and will be removed in a future version. Switch to using
optimizeDeps.noDiscoveryand an empty or undefinedoptimizeDeps.include. true or 'dev' disables the optimizer, false or 'build' leaves it enabled.