website/docs/en/plugins/dll-plugin.mdx
import Attribution from '@components/Attribution';
The DllPlugin is used in a separate rspack configuration exclusively to create a dll-only-bundle.
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.
type DllPluginOptions = {
context?: string;
entryOnly?: boolean;
format?: boolean;
name?: string;
path: string;
type?: string;
};
stringSets the context used for requests in the manifest file.
booleantrueIf true, only entry modules are exposed.
booleanfalseControls whether the generated manifest JSON is formatted for readability.
stringundefinedSets the name of the exposed DLL function. Configure it to match the DLL bundle's output.library name.
stringSets the absolute output path of the manifest JSON file. This option is required.
stringundefinedSets the external type of the DLL bundle. Configure it to match output.library.type.