ExternalModule hooks
ExternalModule represents a dependency whose implementation is provided by the runtime environment instead of being bundled by Rspack. It provides hooks for controlling how external modules are assigned to chunks.
You can obtain these hooks as follows:
rspack.config.mjs
chunkCondition
SyncBailHook<[Chunk, Compilation], boolean | undefined>
Controls whether an external module can be included in a chunk. Return true to allow the external module in the chunk, false to disallow it, or undefined to continue to subsequent taps and then use Rspack's default behavior.
The following example only allows external modules to be included in entry chunks:

