Optional Experimental disabled'build'
Optional esbuildOptions 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 pluginOptional excludeDo not optimize these dependencies (must be resolvable import paths, cannot be globs).
Optional Experimental extensionsList 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 Experimental holdWhen 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 explicitely
defined ones in include, it is better to disable this option to let the
browser process more requests in parallel.
true
@experimental
Optional includeForce optimize listed dependencies (must be resolvable import paths, cannot be globs).
Optional Experimental needsForces ESM interop when importing these dependencies. Some legacy
packages advertise themselves as ESM but use require internally
Optional Experimental noAutomatic 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.
false
@experimental
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.