(url, context, nextLoad)
| 2 | import { fileURLToPath } from 'node:url'; |
| 3 | |
| 4 | export async function load(url, context, nextLoad) { |
| 5 | const result = await nextLoad(url, context); |
| 6 | if (url.endsWith('/common/index.js')) { |
| 7 | result.source = '"use strict";module.exports=require("node:module").createRequire(' + |
| 8 | JSON.stringify(url) + ')(' + JSON.stringify(fileURLToPath(url)) + ');\n'; |
| 9 | } else if (url.startsWith('file:') && (context.format == null || context.format === 'commonjs')) { |
| 10 | result.source = await readFile(new URL(url)); |
| 11 | } |
| 12 | return result; |
| 13 | } |
nothing calls this directly
no test coverage detected