fix: hide bundled runtime npm windows

This commit is contained in:
Peter Steinberger
2026-04-27 08:30:59 +01:00
parent 720ea766e6
commit d23ee2f702
7 changed files with 74 additions and 2 deletions

View File

@@ -817,6 +817,7 @@ export function runBundledPluginPostinstall(params = {}) {
encoding: "utf8",
env: npmRunner.env ?? installEnv,
stdio: "pipe",
windowsHide: true,
shell: npmRunner.shell,
windowsVerbatimArguments: npmRunner.windowsVerbatimArguments,
});

View File

@@ -877,13 +877,15 @@ function runNpmInstall(params) {
npm_config_save: "false",
npm_config_yes: "true",
};
const result = spawnSync(params.npmRunner.command, params.npmRunner.args, {
const runSpawnSync = params.spawnSyncImpl ?? spawnSync;
const result = runSpawnSync(params.npmRunner.command, params.npmRunner.args, {
cwd: params.cwd,
encoding: "utf8",
env: npmEnv,
shell: params.npmRunner.shell,
stdio: ["ignore", "pipe", "pipe"],
timeout: params.timeoutMs ?? 5 * 60 * 1000,
windowsHide: true,
windowsVerbatimArguments: params.npmRunner.windowsVerbatimArguments,
});
if (result.status === 0) {
@@ -1240,6 +1242,10 @@ export function stageBundledPluginRuntimeDeps(params = {}) {
}
}
export const __testing = {
runNpmInstall,
};
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
stageBundledPluginRuntimeDeps();
}