Files
Kmake/test/fixtures/es-module-loaders/hooks-initialize-port.mjs
2026-05-26 23:36:42 -07:00

17 lines
349 B
JavaScript

let thePort = null;
export async function initialize(port) {
port.postMessage('initialize');
thePort = port;
}
export async function resolve(specifier, context, next) {
if (specifier === 'node:fs' || specifier.includes('loader')) {
return next(specifier);
}
thePort.postMessage(`resolve ${specifier}`);
return next(specifier);
}