mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
b64c3ee6cb
The current API shape si not great because it's too limited and redundant with the use of `MessagePort`. PR-URL: https://github.com/nodejs/node/pull/49529 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Jacob Smith <jacob@frende.me>
17 lines
349 B
JavaScript
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);
|
|
}
|