runtimePlugins
- Type:
string[] | Array<[string, Record<string, unknown>]> - Required: No
- Default:
undefined
The runtimePlugins configuration is used to add additional plugins needed at runtime. The value can be:
- A string representing the path to the specific plugin (absolute/relative path or package name)
- An array where each element can be either a string or a tuple with [string path, object options]
You can learn more about how to develop runtimePlugin details by visiting the Plugin System.
Once set, runtime plugins will be automatically injected and used during the build process.
- Examples
Basic usage:
To create a runtime plugin file, you can name it custom-runtime-plugin.ts:
custom-runtime-plugin.ts
Then, apply this plugin in your build configuration:
rspack.config.ts
With options: You can also provide options to runtime plugins by using a tuple format:
rspack.config.ts
The plugin can then access these options:
another-plugin.ts