new·Earn with mozg — 20% of every monthSend somebody here and take a fifth of every plan payment they make, for as long as they keep paying — not a bounty on the first invoice. Your handle is the link, the window is thirty days, and the commission lands on your balance the second they pay. Free to join: if you have signed in, you already have the link. mozg.sh/earnall news →
mozg.beta
Sign in

Vite · Config reference · all subjects

build options: output control

12 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

assetsInlineLimit controls asset inlining threshold

Assets smaller in bytes than the assetsInlineLimit option will be inlined as base64 data URLs. This is a build option that determines the file size threshold for automatic inlining.

build.assetsDir type and default

build.assetsDir is type string with default value 'assets'. It specifies the directory to nest generated assets under, relative to build.outDir. This is not used in Library Mode.

build.outDir type and default

build.outDir is type string with default value 'dist'. It specifies the output directory relative to project root.

build.assetsInlineLimit type and default

build.assetsInlineLimit is type number | ((filePath: string, content: Buffer) => boolean | undefined), with default value 4096 (4 KiB). Imported or referenced assets smaller than this threshold are inlined as base64 URLs. Set to 0 to disable inlining. If a callback is passed, a boolean can be returned to opt-in or opt-out, or nothing can be returned to apply default logic. Git LFS placeholders are automatically excluded from inlining.

build.license type and default

build.license is type boolean | { fileName?: string }, with default value false. When set to true, the build generates a .vite/license.md file including all bundled dependencies' licenses. If fileName is passed, it will be used as the license file name relative to outDir. If it ends with .json, raw JSON metadata is generated instead.

build.manifest type and default

build.manifest is type boolean | string, with default value false. When true or a string, it generates a manifest file containing a mapping of non-hashed asset filenames to their hashed versions. When the value is a string, it is used as the manifest file path relative to build.outDir. When set to true, the path is .vite/manifest.json.

build.write type and default

build.write is type boolean with default value true. Set to false to disable writing the bundle to disk. This is mostly used in programmatic build() calls where further post processing is needed before writing to disk.

build.emptyOutDir type and default value

build.emptyOutDir is type boolean with default value true if outDir is inside root. By default, Vite empties the outDir on build if it is inside project root. It emits a warning if outDir is outside root to avoid accidentally removing important files. You can explicitly set this option to suppress the warning.

build.copyPublicDir type and default

build.copyPublicDir is type boolean with default value true. By default, Vite copies files from publicDir into outDir on build. Set to false to disable this.

build.reportCompressedSize type and default

build.reportCompressedSize is type boolean with default value true. It enables/disables gzip-compressed size reporting. Compressing large output files can be slow, so disabling this may increase build performance for large projects.

build.chunkSizeWarningLimit type and default

build.chunkSizeWarningLimit is type number with default value 500. It is the limit for chunk size warnings in kB, compared against the uncompressed chunk size.

build.license example with JSON output

Example of build.license generating JSON metadata output: ```json [ { "name": "dep-1", "version": "1.2.3", "identifier": "CC0-1.0", "text": "CC0 1.0 Universal\n\n..." }, { "name": "dep-2", "version": "4.5.6", "identifier": "MIT", "text": "MIT License\n\n..." } ] ```

Give your agent this brain