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

DllPlugin

The DllPlugin is used in a separate rspack configuration exclusively to create a dll-only-bundle.

Options

  • Type:
type DllPluginOptions = {
  context?: string;
  entryOnly?: boolean;
  format?: boolean;
  name?: string;
  path: string;
  type?: string;
};
NameTypeDefaultDescription
contextstringThe rspack compiler contextcontext of requests in the manifest file
pathstringundefinedabsolute path to the manifest json file
entryOnlybooleantrueif true, only entry points will be exposed
formatbooleanundefinedWhether or not format manifest json
namestringundefinedThe expose dll function name
typestringundefinedtype of the dll bundle

Examples

new rspack.DllPlugin({
  path: path.resolve(__dirname, 'manifest.json'),
  name: '[name]_dll_lib',
});

The Plugin will create a manifest.json which is written to the given path. It contains mappings from require and import requests to module ids.

The manifest.json is used by the DllReferencePlugin

Combine this plugin with output.library options to expose the dll function.

This page is adapted from webpack documentation under the CC BY 4.0, with modifications.