loader.mjs (1876:f85b85094541) loader.mjs (2117:0e4bb7b44a63)
1// must be ran as part of a --loader or --experimental-loader param
2export async function resolve(specifier, context, defaultResolver) {
3 switch (specifier) {
4 case "websocket":
5 return {
6 url: new URL("./websocket.js", import.meta.url).href,
1// must be ran as part of a --loader or --experimental-loader param
2export async function resolve(specifier, context, defaultResolver) {
3 switch (specifier) {
4 case "websocket":
5 return {
6 url: new URL("./websocket.js", import.meta.url).href,
7 format: "cjs"
7 format: "commonjs"
8 }
9
10 case "http":
11 return {
12 url: new URL("./http.js", import.meta.url).href,
8 }
9
10 case "http":
11 return {
12 url: new URL("./http.js", import.meta.url).href,
13 format: "cjs"
13 format: "commonjs"
14 }
15 }
16
17 return defaultResolver(specifier, context, defaultResolver)
18}
14 }
15 }
16
17 return defaultResolver(specifier, context, defaultResolver)
18}