Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Jul 14, 2022
1 parent 6a32783 commit 77bb2be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dist-raw/runmain-hack.js
@@ -1,7 +1,9 @@
const {pathToFileURL} = require('url');

// Hack to avoid Module.runMain on node 18.6.0
// Keeping it simple for now, isolated in this file.
// Could theoretically probe `getFormat` impl to determine if `import()` or `Module._load()` is best
// Note that I attempted a try-catch around `Module._load`, but it poisons some sort of cache such that subsequent `import()` is impossible.
exports.run = function(entryPointPath) {
import(entryPointPath);
import(pathToFileURL(entryPointPath));
}

0 comments on commit 77bb2be

Please sign in to comment.