Fork Horse repository, listed by its owner. Publisher snapshot.

packages/forkhorse-gatekeeper/test/node-runtime.ts

Snapshot at 34e3175

Containing directory

437 bytes · typescriptView raw
1import { registerHooks } from "node:module";
2
3// Root and frozen upstream install separately. One RPC session must use one Cap'n Web runtime
4// identity, just as the Vite bundle does; equal versions in two installs are not the same class.
5const capnweb = import.meta.resolve("capnweb");
6registerHooks({
7  resolve(specifier, context, nextResolve) {
8    return nextResolve(specifier === "capnweb" ? capnweb : specifier, context);
9  },
10});
11