For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt, and this page is available as Markdown at /zh/plugins/webpack/runtime-chunk-plugin.md.
close

RuntimeChunkPlugin

此插件用来控制 runtime chunk 如何生成,optimization.runtimeChunk 底层使用了该插件。

选项

name

用来配置 runtime chunk 的名字,可以是字符串也可以是个返回字符串函数,函数参数为入口的名字。

  • 类型: string | ((entrypoint: { name: string }) => string)
new rspack.optimize.RuntimeChunkPlugin({
  name: ({ name }) => `runtime~${name}`,
});