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:
@@ -100,6 +100,12 @@ object, notably with Falcon.
|
|||||||
</para>
|
</para>
|
||||||
</change>
|
</change>
|
||||||
|
|
||||||
|
<change type="bugfix">
|
||||||
|
<para>
|
||||||
|
ECMAScript modules did not work with the recent Node.js versions.
|
||||||
|
</para>
|
||||||
|
</change>
|
||||||
|
|
||||||
</changes>
|
</changes>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ export async function resolve(specifier, context, defaultResolver) {
|
|||||||
case "websocket":
|
case "websocket":
|
||||||
return {
|
return {
|
||||||
url: new URL("./websocket.js", import.meta.url).href,
|
url: new URL("./websocket.js", import.meta.url).href,
|
||||||
format: "cjs"
|
format: "commonjs"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "http":
|
case "http":
|
||||||
return {
|
return {
|
||||||
url: new URL("./http.js", import.meta.url).href,
|
url: new URL("./http.js", import.meta.url).href,
|
||||||
format: "cjs"
|
format: "commonjs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user