Adds an entry chunk on compilation. The chunk is named options.name and contains only one module (plus dependencies). The module is resolved from entry in context (absolute path).
new rspack.EntryPlugin(context, entry, options);The module is resolved from entry in context (absolute path).
stringThe module path for the entry module.
stringTo adjust settings related to the entry module.
type EntryOptions =
| string
| (Omit<EntryDescriptionNormalized, 'import'> & {
/**
* The name of the entry chunk.
*/
name?: string;
});If options is a string, its value will be used as name.
Refer to Entry description object for all available options.
When the plugin's name option is set to undefined, the entry is treated as a global entry. It's automatically injected into:
new Worker())This allows you to inject global runtime code, such as the dev server's HMR runtime or the initialization logic for module federation.
new rspack.EntryPlugin(context, './global-runtime.js', { name: undefined });