KC's Workspace
    Preparing search index...
    interface OutputOptions {
        advancedChunks?: {
            groups?: {
                maxModuleSize?: number;
                maxSize?: number;
                minModuleSize?: number;
                minShareCount?: number;
                minSize?: number;
                name: string | AdvancedChunksNameFunction;
                priority?: number;
                test?: StringOrRegExp | AdvancedChunksTestFunction;
            }[];
            includeDependenciesRecursively?: boolean;
            maxModuleSize?: number;
            maxSize?: number;
            minModuleSize?: number;
            minShareCount?: number;
            minSize?: number;
        };
        assetFileNames?: string
        | AssetFileNamesFunction;
        banner?: string | AddonFunction;
        chunkFileNames?: string | ChunkFileNamesFunction;
        cleanDir?: boolean;
        cssChunkFileNames?: string | ChunkFileNamesFunction;
        cssEntryFileNames?: string | ChunkFileNamesFunction;
        dir?: string;
        entryFileNames?: string | ChunkFileNamesFunction;
        esModule?: boolean | "if-default-prop";
        exports?: "auto" | "named" | "default" | "none";
        extend?: boolean;
        externalLiveBindings?: boolean;
        file?: string;
        footer?: string | AddonFunction;
        format?: ModuleFormat;
        generatedCode?: Partial<GeneratedCodeOptions>;
        globals?: Record<string, string> | GlobalsFunction;
        hashCharacters?: "base64" | "base36" | "hex";
        hoistTransitiveImports?: false;
        inlineDynamicImports?: boolean;
        intro?: string | AddonFunction;
        keepNames?: boolean;
        legalComments?: "inline" | "none";
        manualChunks?: ManualChunksFunction;
        minify?: boolean | "dce-only" | MinifyOptions;
        minifyInternalExports?: boolean;
        name?: string;
        outro?: string | AddonFunction;
        paths?: Record<string, string> | PathsFunction$1;
        plugins?: RolldownOutputPluginOption;
        polyfillRequire?: boolean;
        postBanner?: string | AddonFunction;
        postFooter?: string | AddonFunction;
        preserveModules?: boolean;
        preserveModulesRoot?: string;
        sanitizeFileName?: boolean | SanitizeFileNameFunction;
        sourcemap?: boolean | "inline" | "hidden";
        sourcemapBaseUrl?: string;
        sourcemapDebugIds?: boolean;
        sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption | StringOrRegExp;
        sourcemapPathTransform?: SourcemapPathTransformOption;
        topLevelVar?: boolean;
        virtualDirname?: string;
    }
    Index

    Properties

    advancedChunks?: {
        groups?: {
            maxModuleSize?: number;
            maxSize?: number;
            minModuleSize?: number;
            minShareCount?: number;
            minSize?: number;
            name: string | AdvancedChunksNameFunction;
            priority?: number;
            test?: StringOrRegExp | AdvancedChunksTestFunction;
        }[];
        includeDependenciesRecursively?: boolean;
        maxModuleSize?: number;
        maxSize?: number;
        minModuleSize?: number;
        minShareCount?: number;
        minSize?: number;
    }

    Allows you to do manual chunking. For deeper understanding, please refer to the in-depth documentation.

    Type Declaration

    • Optionalgroups?: {
          maxModuleSize?: number;
          maxSize?: number;
          minModuleSize?: number;
          minShareCount?: number;
          minSize?: number;
          name: string | AdvancedChunksNameFunction;
          priority?: number;
          test?: StringOrRegExp | AdvancedChunksTestFunction;
      }[]

      Groups to be used for advanced chunking.

    • OptionalincludeDependenciesRecursively?: boolean
      • Type: boolean
      • Default: true

      By default, each group will also include captured modules' dependencies. This reduces the chance of generating circular chunks.

      If you want to disable this behavior, it's recommended to both set

      • preserveEntrySignatures: false | 'allow-extension'
      • strictExecutionOrder: true

      to avoid generating invalid chunks.

    • OptionalmaxModuleSize?: number
      • Type: number

      Global fallback of {group}.maxModuleSize, if it's not specified in the group.

    • OptionalmaxSize?: number
      • Type: number

      Global fallback of {group}.maxSize, if it's not specified in the group.

    • OptionalminModuleSize?: number
      • Type: number

      Global fallback of {group}.minModuleSize, if it's not specified in the group.

    • OptionalminShareCount?: number
      • Type: number

      Global fallback of {group}.minShareCount, if it's not specified in the group.

    • OptionalminSize?: number
      • Type: number

      Global fallback of {group}.minSize, if it's not specified in the group.

    assetFileNames?: string | AssetFileNamesFunction
    banner?: string | AddonFunction
    chunkFileNames?: string | ChunkFileNamesFunction
    cleanDir?: boolean
    • Type: boolean
    • Default: false

    Clean output directory before emitting output.

    cssChunkFileNames?: string | ChunkFileNamesFunction
    cssEntryFileNames?: string | ChunkFileNamesFunction
    dir?: string
    entryFileNames?: string | ChunkFileNamesFunction
    esModule?: boolean | "if-default-prop"
    exports?: "auto" | "named" | "default" | "none"
    extend?: boolean
    externalLiveBindings?: boolean
    file?: string
    footer?: string | AddonFunction
    format?: ModuleFormat

    Expected format of generated code.

    'esm'
    
    generatedCode?: Partial<GeneratedCodeOptions>
    globals?: Record<string, string> | GlobalsFunction
    hashCharacters?: "base64" | "base36" | "hex"
    hoistTransitiveImports?: false
    inlineDynamicImports?: boolean
    intro?: string | AddonFunction
    keepNames?: boolean

    Keep function and class names after bundling.

    When enabled, the bundler will preserve the original names of functions and classes in the output, which is useful for debugging and error stack traces.

    false
    
    legalComments?: "inline" | "none"

    Control comments in the output.

    • none: no comments
    • inline: preserve comments that contain @license, @preserve or starts with //! /*!
    manualChunks?: ManualChunksFunction
    • Type: ((moduleId: string, meta: { getModuleInfo: (moduleId: string) => ModuleInfo | null }) => string | NullValue)
    • Object form is not supported.

    :::warning

    • This option is deprecated. Please use advancedChunks instead.
    • If manualChunks and advancedChunks are both specified, manualChunks option will be ignored. :::

    You could use this option for migration purpose. Under the hood,

    {
    manualChunks: (moduleId, meta) => {
    if (moduleId.includes('node_modules')) {
    return 'vendor';
    }
    return null;
    }
    }

    will be transformed to

    {
    advancedChunks: {
    groups: [
    {
    name(moduleId) {
    if (moduleId.includes('node_modules')) {
    return 'vendor';
    }
    return null;
    },
    },
    ],
    }
    }

    Please use advancedChunks instead.

    minify?: boolean | "dce-only" | MinifyOptions

    Control code minification.

    • true: Enable full minification including code compression and dead code elimination
    • false: Disable minification (default)
    • 'dce-only': Only perform dead code elimination without code compression
    • MinifyOptions: Fine-grained control over minification settings
    false
    
    minifyInternalExports?: boolean
    • Type: boolean
    • Default: true for format es or if output.minify is true or object, false otherwise

    Whether to minify internal exports.

    name?: string
    outro?: string | AddonFunction
    paths?: Record<string, string> | PathsFunction$1

    Maps external module IDs to paths.

    Allows customizing the path used when importing external dependencies. This is particularly useful for loading dependencies from CDNs or custom locations.

    • Object form: Maps module IDs to their replacement paths
    • Function form: Takes a module ID and returns its replacement path
    {
    paths: {
    'd3': 'https://cdn.jsdelivr.net/npm/d3@7'
    }
    }
    {
    paths: (id) => {
    if (id.startsWith('lodash')) {
    return `https://cdn.jsdelivr.net/npm/${id}`
    }
    return id
    }
    }
    polyfillRequire?: boolean
    postBanner?: string | AddonFunction

    Similar to banner option, but will run after the renderChunk hook and builtin minification.

    postFooter?: string | AddonFunction

    Similar to footer option, but will run after the renderChunk hook and builtin minification.

    preserveModules?: boolean
    preserveModulesRoot?: string
    sanitizeFileName?: boolean | SanitizeFileNameFunction
    sourcemap?: boolean | "inline" | "hidden"
    sourcemapBaseUrl?: string
    sourcemapDebugIds?: boolean
    sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption | StringOrRegExp

    Control which source files are included in the sourcemap ignore list. Files in the ignore list are excluded from debugger stepping and error stack traces.

    • false: Include all source files in the ignore list
    • true: Include no source files in the ignore list
    • string: Files containing this string in their path will be included in the ignore list
    • RegExp: Files matching this regular expression will be included in the ignore list
    • function: Custom function (source: string, sourcemapPath: string) => boolean to determine if a source should be ignored

    :::tip Performance Using static values (boolean, string, or RegExp) is significantly more performant than functions. Calling JavaScript functions from Rust has extremely high overhead, so prefer static patterns when possible. :::

    // ✅ Preferred: Use RegExp for better performance
    sourcemapIgnoreList: /node_modules/

    // ✅ Preferred: Use string pattern for better performance
    sourcemapIgnoreList: "vendor"

    // ! Use sparingly: Function calls have high overhead
    sourcemapIgnoreList: (source, sourcemapPath) => {
    return source.includes('node_modules') || source.includes('.min.');
    }

    default: /node_modules/

    sourcemapPathTransform?: SourcemapPathTransformOption
    topLevelVar?: boolean
    virtualDirname?: string