KC's Workspace
    Preparing search index...
    interface BuildEnvironmentOptions {
        assetsDir?: string;
        assetsInlineLimit?:
            | number
            | ((filePath: string, content: Buffer) => boolean | undefined);
        chunkSizeWarningLimit?: number;
        commonjsOptions?: RollupCommonJSOptions;
        copyPublicDir?: boolean;
        createEnvironment?: (
            name: string,
            config: ResolvedConfig,
        ) => BuildEnvironment | Promise<BuildEnvironment>;
        cssCodeSplit?: boolean;
        cssMinify?: boolean | "lightningcss" | "esbuild";
        cssTarget?: string | false | string[];
        dynamicImportVarsOptions?: RollupDynamicImportVarsOptions;
        emitAssets?: boolean;
        emptyOutDir?: boolean | null;
        lib?: false | LibraryOptions;
        license?: boolean | LicenseOptions;
        manifest?: string | boolean;
        minify?: boolean | "esbuild" | "terser";
        modulePreload?: boolean | ModulePreloadOptions;
        outDir?: string;
        polyfillModulePreload?: boolean;
        reportCompressedSize?: boolean;
        rollupOptions?: RollupOptions;
        sourcemap?: boolean | "inline" | "hidden";
        ssr?: string | boolean;
        ssrEmitAssets?: boolean;
        ssrManifest?: string | boolean;
        target?: string | false | string[];
        terserOptions?: TerserOptions;
        watch?: WatcherOptions | null;
        write?: boolean;
    }
    Index

    Properties

    assetsDir?: string

    Directory relative from outDir where the built js/css/image assets will be placed.

    'assets'
    
    assetsInlineLimit?:
        | number
        | ((filePath: string, content: Buffer) => boolean | undefined)

    Static asset files smaller than this number (in bytes) will be inlined as base64 strings. If a callback is passed, a boolean can be returned to opt-in or opt-out of inlining. If nothing is returned the default logic applies.

    Default limit is 4096 (4 KiB). Set to 0 to disable.

    4096
    
    chunkSizeWarningLimit?: number

    Adjust chunk size warning limit (in kB).

    500
    
    commonjsOptions?: RollupCommonJSOptions

    Options to pass on to @rollup/plugin-commonjs

    copyPublicDir?: boolean

    Copy the public directory to outDir on write.

    true
    
    createEnvironment?: (
        name: string,
        config: ResolvedConfig,
    ) => BuildEnvironment | Promise<BuildEnvironment>

    create the Build Environment instance

    cssCodeSplit?: boolean

    Whether 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
    
    cssMinify?: boolean | "lightningcss" | "esbuild"

    Override CSS minification specifically instead of defaulting to build.minify, so you can configure minification for JS and CSS separately.

    'esbuild'
    
    cssTarget?: string | false | string[]

    An 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
    
    dynamicImportVarsOptions?: RollupDynamicImportVarsOptions

    Options to pass on to @rollup/plugin-dynamic-import-vars

    emitAssets?: boolean

    Emit assets during build. Frameworks can set environments.ssr.build.emitAssets By default, it is true for the client and false for other environments.

    emptyOutDir?: boolean | null

    Empty outDir on write.

    true when outDir is a sub directory of project root
    
    lib?: false | LibraryOptions

    Build 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
    
    license?: boolean | LicenseOptions

    Whether to emit a .vite/license.md file that includes all bundled dependencies' licenses. Pass an object to customize the output file name.

    false
    
    manifest?: string | boolean

    Whether to emit a .vite/manifest.json in the output 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
    
    minify?: boolean | "esbuild" | "terser"

    Set to false to disable minification, or specify the minifier to use. Available options are 'terser' or 'esbuild'.

    'esbuild'
    
    modulePreload?: boolean | ModulePreloadOptions

    Configure module preload Note: does not apply to library mode.

    true
    
    outDir?: string

    Directory relative from root where build output will be placed. If the directory exists, it will be removed before the build.

    'dist'
    
    polyfillModulePreload?: boolean

    whether to inject module preload polyfill. Note: does not apply to library mode.

    true
    

    use modulePreload.polyfill instead

    reportCompressedSize?: boolean

    Set to false to disable reporting compressed chunk sizes. Can slightly improve build speed.

    true
    
    rollupOptions?: RollupOptions

    Will be merged with internal rollup options. https://rollupjs.org/configuration-options/

    sourcemap?: boolean | "inline" | "hidden"

    If 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
    
    ssr?: string | boolean

    Produce SSR oriented build. Note this requires specifying SSR entry via rollupOptions.input.

    false
    
    ssrEmitAssets?: boolean

    Emit assets during SSR.

    false
    
    ssrManifest?: string | boolean

    Generate SSR manifest for determining style links and asset preload directives in production.

    false
    
    target?: string | false | string[]

    Compatibility transform target. The transform is performed with esbuild and the lowest supported target is es2015. Note this only handles syntax transformation and does not cover polyfills

    Default: 'baseline-widely-available' - transpile targeting browsers that are included in the Baseline Widely Available on 2025-05-01. (Chrome 107+, Edge 107+, Firefox 104+, Safari 16+).

    Another special value is 'esnext' - which only performs minimal transpiling (for minification compat).

    For custom targets, see https://esbuild.github.io/api/#target and https://esbuild.github.io/content-types/#javascript for more details.

    'baseline-widely-available'
    
    terserOptions?: TerserOptions

    Options 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.

    watch?: WatcherOptions | null
    null
    
    write?: boolean

    Whether to write bundle to disk

    true