Optional assets'assets'
Optional assetsStatic asset files smaller than this number (in bytes) will be inlined as
base64 strings. Default limit is 4096 (4 KiB). Set to 0 to disable.
4096
Optional chunkAdjust chunk size warning limit (in kB).
500
Optional commonjsOptions to pass on to @rollup/plugin-commonjs
Optional copyCopy the public directory to outDir on write.
true
Optional cssWhether to code-split CSS. When enabled, CSS in async chunks will be inlined as strings in the chunk and inserted via dynamically created style tags when the chunk is loaded.
true
Optional cssOverride CSS minification specifically instead of defaulting to build.minify,
so you can configure minification for JS and CSS separately.
'esbuild'
Optional cssAn optional separate target for CSS minification. As esbuild only supports configuring targets to mainstream browsers, users may need this option when they are targeting a niche browser that comes with most modern JavaScript features but has poor CSS support, e.g. Android WeChat WebView, which doesn't support the #RGBA syntax.
target
Optional dynamicOptions to pass on to @rollup/plugin-dynamic-import-vars
Optional emptyEmpty outDir on write.
true when outDir is a sub directory of project root
Optional libBuild in library mode. The value should be the global name of the lib in UMD mode. This will produce esm + cjs + umd bundle formats with default configurations that are suitable for distributing libraries.
false
Optional manifestWhether to emit a .vite/manifest.json under assets dir to map hash-less filenames to their hashed versions. Useful when you want to generate your own HTML instead of using the one generated by Vite.
Example:
{
"main.js": {
"file": "main.68fe3fad.js",
"css": "main.e6b63442.css",
"imports": [...],
"dynamicImports": [...]
}
}
false
Optional minifySet to false to disable minification, or specify the minifier to use.
Available options are 'terser' or 'esbuild'.
'esbuild'
Optional moduleConfigure module preload Note: does not apply to library mode.
true
Optional outDirectory relative from root where build output will be placed. If the
directory exists, it will be removed before the build.
'dist'
Optional polyfillwhether to inject module preload polyfill. Note: does not apply to library mode.
true
use modulePreload.polyfill instead
Optional reportSet to false to disable reporting compressed chunk sizes. Can slightly improve build speed.
true
Optional rollupWill be merged with internal rollup options. https://rollupjs.org/configuration-options/
Optional sourcemapIf true, a separate sourcemap file will be created. If 'inline', the
sourcemap will be appended to the resulting output file as data URI.
'hidden' works like true except that the corresponding sourcemap
comments in the bundled files are suppressed.
false
Optional ssrProduce SSR oriented build. Note this requires specifying SSR entry via
rollupOptions.input.
false
Optional ssrEmit assets during SSR.
false
Optional ssrGenerate SSR manifest for determining style links and asset preload directives in production.
false
Optional targetCompatibility transform target. The transform is performed with esbuild and the lowest supported target is es2015/es6. Note this only handles syntax transformation and does not cover polyfills (except for dynamic import)
Default: 'modules' - Similar to @babel/preset-env's targets.esmodules,
transpile targeting browsers that natively support dynamic es module imports.
https://caniuse.com/es6-module-dynamic-import
Another special value is 'esnext' - which only performs minimal transpiling (for minification compat) and assumes native dynamic imports support.
For custom targets, see https://esbuild.github.io/api/#target and https://esbuild.github.io/content-types/#javascript for more details.
'modules'
Optional terserOptions for terser https://terser.org/docs/api-reference#minify-options
In addition, you can also pass a maxWorkers: number option to specify the
max number of workers to spawn. Defaults to the number of CPUs minus 1.
Optional watchRollup watch options https://rollupjs.org/configuration-options/#watch
null
Optional writeWhether to write bundle to disk
true
Directory relative from
outDirwhere the built js/css/image assets will be placed.