For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/packages/rspeedy/interfaces/ChunkSplitBySize.md.
Lynx
  • English
  • Interface: ChunkSplitBySize

    Performance.chunkSplit is used to configure the chunk splitting strategy.

    Deprecated

    Use the top-level Config.splitChunks option instead.

    Properties

    maxSize?

    optional maxSize?: number

    The maximum size of a chunk, unit in bytes.

    Default Value

    Number.POSITIVE_INFINITY

    Example

    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      performance: {
        chunkSplit: {
          strategy: 'split-by-size',
          maxSize: 50000,
        },
      },
    })

    minSize?

    optional minSize?: number

    The minimum size of a chunk, unit in bytes.

    Default Value

    10000

    Example

    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      performance: {
        chunkSplit: {
          strategy: 'split-by-size',
          minSize: 20000,
        },
      },
    })

    override?

    optional override?: false | OptimizationSplitChunksOptions

    Custom Rspack chunk splitting config can be specified.

    Default Value

    undefined

    strategy

    strategy: "split-by-size"

    The ChunkSplitting strategy.

    Remarks

    • split-by-experience(Rsbuild default): an empirical splitting strategy, automatically splits some commonly used npm packages into chunks of moderate size.

    • split-by-module: split by NPM package granularity, each NPM package corresponds to a chunk.

    • split-by-size: automatically split according to module size.

    • all-in-one: bundle all codes into one chunk.

    • single-vendor: bundle all NPM packages into a single chunk.

    • custom: custom chunk splitting strategy.

    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.