跳到正文

Interface: OutputOptions

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:222

Properties

advancedChunks?

ts
optional advancedChunks: object;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:389

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

groups?

ts
optional groups: object[];

Groups to be used for advanced chunking.

includeDependenciesRecursively?

ts
optional includeDependenciesRecursively: 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.

maxModuleSize?

ts
optional maxModuleSize: number;
  • Type: number

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

maxSize?

ts
optional maxSize: number;
  • Type: number

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

minModuleSize?

ts
optional minModuleSize: number;
  • Type: number

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

minShareCount?

ts
optional minShareCount: number;
  • Type: number

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

minSize?

ts
optional minSize: number;
  • Type: number

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


assetFileNames?

ts
optional assetFileNames: string | AssetFileNamesFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:287


ts
optional banner: string | AddonFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:273


chunkFileNames?

ts
optional chunkFileNames:
  | string
  | ChunkFileNamesFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:289


cleanDir?

ts
optional cleanDir: boolean;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:604

  • Type: boolean
  • Default: false

Clean output directory before emitting output.


cssChunkFileNames?

ts
optional cssChunkFileNames:
  | string
  | ChunkFileNamesFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:291


cssEntryFileNames?

ts
optional cssEntryFileNames:
  | string
  | ChunkFileNamesFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:290


dir?

ts
optional dir: string;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:223


dynamicImportInCjs?

ts
optional dynamicImportInCjs: boolean;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:340


entryFileNames?

ts
optional entryFileNames:
  | string
  | ChunkFileNamesFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:288


esModule?

ts
optional esModule: boolean | "if-default-prop";

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:286


exports?

ts
optional exports: "default" | "auto" | "named" | "none";

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:225


extend?

ts
optional extend: boolean;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:285


externalLiveBindings?

ts
optional externalLiveBindings: boolean;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:338


file?

ts
optional file: string;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:224


ts
optional footer: string | AddonFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:274


format?

ts
optional format: ModuleFormat;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:236

Expected format of generated code.

Default

ts
'esm'

generatedCode?

ts
optional generatedCode: Partial<GeneratedCodeOptions>;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:337


globals?

ts
optional globals:
  | Record<string, string>
  | GlobalsFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:305


hashCharacters?

ts
optional hashCharacters: "base64" | "hex" | "base36";

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:226


hoistTransitiveImports?

ts
optional hoistTransitiveImports: false;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:586


inlineDynamicImports?

ts
optional inlineDynamicImports: boolean;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:339


intro?

ts
optional intro: string | AddonFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:283


keepNames?

ts
optional keepNames: boolean;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:612

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.

Default

ts
false

legalComments?

ts
optional legalComments: "inline" | "none";

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:583

Control comments in the output.

  • none: no comments
  • inline: preserve comments that contain @license, @preserve or starts with //! /*!

manualChunks?

ts
optional manualChunks: ManualChunksFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:385

  • 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,

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

will be transformed to

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

Deprecated

Please use advancedChunks instead.


minify?

ts
optional minify:
  | boolean
  | MinifyOptions
  | "dce-only";

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:303

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

Default

ts
false

minifyInternalExports?

ts
optional minifyInternalExports: boolean;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:597

  • Type: boolean
  • Default: true for format es or if output.minify is true or object, false otherwise

Whether to minify internal exports.


name?

ts
optional name: string;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:304


outro?

ts
optional outro: string | AddonFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:284


paths?

ts
optional paths: Record<string, string> | PathsFunction$1;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:336

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

Examples

js
{
  paths: {
    'd3': 'https://cdn.jsdelivr.net/npm/d3@7'
  }
}
js
{
  paths: (id) => {
    if (id.startsWith('lodash')) {
      return `https://cdn.jsdelivr.net/npm/${id}`
    }
    return id
  }
}

plugins?

ts
optional plugins: RolldownOutputPluginOption;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:584


polyfillRequire?

ts
optional polyfillRequire: boolean;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:585


postBanner?

ts
optional postBanner: string | AddonFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:278

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


postFooter?

ts
optional postFooter: string | AddonFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:282

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


preserveModules?

ts
optional preserveModules: boolean;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:587


preserveModulesRoot?

ts
optional preserveModulesRoot: string;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:589


sanitizeFileName?

ts
optional sanitizeFileName: boolean | SanitizeFileNameFunction;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:292


sourcemap?

ts
optional sourcemap: boolean | "hidden" | "inline";

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:237


sourcemapBaseUrl?

ts
optional sourcemapBaseUrl: string;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:238


sourcemapDebugIds?

ts
optional sourcemapDebugIds: boolean;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:239


sourcemapIgnoreList?

ts
optional sourcemapIgnoreList:
  | boolean
  | StringOrRegExp
  | SourcemapIgnoreListOption;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:271

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

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.

Examples

js
// ✅ 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?

ts
optional sourcemapPathTransform: SourcemapPathTransformOption;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:272


topLevelVar?

ts
optional topLevelVar: boolean;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:590


virtualDirname?

ts
optional virtualDirname: string;

Defined in: node_modules/.pnpm/rolldown@1.0.0-beta.58/node_modules/rolldown/dist/shared/define-config-twT5HTur.d.mts:588

Released under the MIT License.