EntryPlugin
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).
Options
context
The module is resolved from entry in context (absolute path).
- Type:
string
entry
The module path for the entry module.
- Type:
string
options
To adjust settings related to the entry module.
- Type:
If options is a string, its value will be used as name.
Refer to Entry description object for all available options.
Global entry
When the plugin's name option is set to undefined, the entry is treated as a global entry. It's automatically injected into:
- All regular entry chunks
- All asynchronous entries (for example, worker chunks created with
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.

