* Load a module via dynamic import(). Works for both CJS and ESM regardless * of the file extension or the package.json "type" field.
(filePath)
| 73 | * of the file extension or the package.json "type" field. |
| 74 | */ |
| 75 | async function loadModule(filePath) { |
| 76 | return import(pathToFileURL(filePath).href); |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Unwrap nested default exports (common with TS/ESM compiled to CJS). |