Node.js: fixed ES modules format in loader.mjs.

Before Node.js v16.14.0 the "format" value in defaultResolve
was ignored so error was hidden.  For more information see:
https://github.com/nodejs/node/pull/40980
This commit is contained in:
Andrei Zeliankou
2022-06-02 11:48:27 +01:00
parent 3d53bba5b3
commit bd80039e07
2 changed files with 8 additions and 2 deletions

View File

@@ -4,13 +4,13 @@ export async function resolve(specifier, context, defaultResolver) {
case "websocket":
return {
url: new URL("./websocket.js", import.meta.url).href,
format: "cjs"
format: "commonjs"
}
case "http":
return {
url: new URL("./http.js", import.meta.url).href,
format: "cjs"
format: "commonjs"
}
}