From f8858af9f3a406459ff4237fe86b01fc646e7e50 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Fri, 18 Jul 2025 22:10:56 +0100 Subject: [PATCH] Fix webpack compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is related to PR #935. Unfortunately, webpack follows even dynamic imports unless told not to. This one-line change adds the magic comment to tell webpack not to try to import ‘node:process’. --- lib/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/main.ts b/lib/main.ts index 29321db96..550c2d5ce 100644 --- a/lib/main.ts +++ b/lib/main.ts @@ -91,8 +91,10 @@ export async function main( } }, *node() { + // Annotate dynamic import so that webpack ignores it. + // See https://webpack.js.org/api/module-methods/#webpackignore let { default: process } = yield* call(() => - import("node:process") + import(/* webpackIgnore: true */ "node:process") ); hardexit = (status) => process.exit(status); try {