Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack workaround #22605

Merged
merged 10 commits into from
Sep 24, 2024
6 changes: 4 additions & 2 deletions src/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,13 @@ if (ENVIRONMENT_IS_NODE) {
// EXPORT_ES6 + ENVIRONMENT_IS_NODE always requires use of import.meta.url,
// since there's no way getting the current absolute path of the module when
// support for that is not available.
scriptDirectory = require('url').fileURLToPath(new URL('./', import.meta.url)); // includes trailing slash
scriptDirectory = nodePath.dirname(require('url').fileURLToPath(import.meta.url));
#else
scriptDirectory = __dirname + '/';
scriptDirectory = __dirname;
#endif

scriptDirectory += '/' // scriptDirectory is expected to end in a "/"
seanmorris marked this conversation as resolved.
Show resolved Hide resolved

#include "node_shell_read.js"

if (!Module['thisProgram'] && process.argv.length > 1) {
Expand Down
Loading