RuntimeChunkPlugin
RuntimeChunkPlugin creates separate Rspack runtime chunks and controls how they are named. optimization.runtimeChunk applies this plugin internally.
Examples
This configuration extracts the Rspack runtime used by two entry points into runtime.js:
rspack.config.mjs
Rspack emits app.js, admin.js, and the shared runtime.js. Separating the Rspack runtime from entry bundles allows them to be cached independently.
Options
name
Sets the name of the Rspack runtime chunk. Accepts a string or a function that receives an entrypoint object with a name property and returns a string.
- Type:
string | ((entrypoint: { name: string }) => string)

