// hud.js imports `mgrs`, whose named exports Node's ESM loader cannot read: // import this module before hud.js to swap it for a stub. import { registerHooks } from 'node:module'; const MGRS_STUB_URL = 'gev-test-stub:mgrs'; registerHooks({ resolve(specifier, context, next) { if (specifier === 'mgrs') return { url: MGRS_STUB_URL, shortCircuit: true }; return next(specifier, context); }, load(url, context, next) { if (url === MGRS_STUB_URL) { return { format: 'module', shortCircuit: true, source: 'export function forward() { return "10SEG55776339"; }\nexport default { forward };\n', }; } return next(url, context); }, });