build: make running of npm ci in build scripts configurable

* moved the running of npm ci from copy-dist to cleanupNodeModules
* added flag to disable it (necessary for electron-forge)
This commit is contained in:
Panagiotis Papadopoulos
2025-03-27 00:00:41 +01:00
parent 0b428035ae
commit 75431ca634
6 changed files with 30 additions and 18 deletions

View File

@@ -47,7 +47,7 @@ module.exports = {
try {
const cleanupNodeModulesScript = path.join(buildPath, "bin", "cleanupNodeModules.ts");
// we don't have access to any devDeps like 'tsx' here, so use the built-in '--experimental-strip-types' flag instead
const command = `node --experimental-strip-types ${cleanupNodeModulesScript} '${buildPath}'`;
const command = `node --experimental-strip-types ${cleanupNodeModulesScript} '${buildPath}' --skip-prune-dev-deps`;
// execSync throws, if above returns any non-zero exit code
execSync(command);
callback()