Node.js: renamed "require_shim" to "loader".

This commit is contained in:
Oisin Canty
2021-05-24 09:01:42 +00:00
parent d643900237
commit c160ea11e4
15 changed files with 16 additions and 16 deletions

View File

@@ -0,0 +1,18 @@
// must be ran as part of a --loader or --experimental-loader param
export async function resolve(specifier, context, defaultResolver) {
switch (specifier) {
case "websocket":
return {
url: new URL("./websocket.js", import.meta.url).href,
format: "cjs"
}
case "http":
return {
url: new URL("./http.js", import.meta.url).href,
format: "cjs"
}
}
return defaultResolver(specifier, context, defaultResolver)
}