Skip to content

manualChunks

  • Type: optional 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,

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.

Released under the MIT License.