Register modules supplied by the host so that plugins which import the same specifiers
(for example because they were built with --external) receive the host's single copy
rather than resolving their own.
Registration is process-global (it uses Bun virtual modules) and must happen before the first
plugin which imports the specifier is loaded. Matching is exact: a subpath such as pkg/sub
must be registered separately from pkg. The registered value is a snapshot of the
namespace object.
Registering the same specifier again with the same exports object is a no-op.
Register modules supplied by the host so that plugins which import the same specifiers (for example because they were built with
--external) receive the host's single copy rather than resolving their own.Registration is process-global (it uses Bun virtual modules) and must happen before the first plugin which imports the specifier is loaded. Matching is exact: a subpath such as
pkg/submust be registered separately frompkg. The registered value is a snapshot of the namespace object.Registering the same specifier again with the same
exportsobject is a no-op.