From 89774929811ab3da35b3eaeb359f4cd26a77bc59 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Sun, 16 Mar 2025 01:12:55 +0100 Subject: [PATCH] build(copy-dist): move "pruning" to copy-dist from copy-trilium.sh --- bin/copy-dist.ts | 4 ++++ bin/copy-trilium.sh | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/copy-dist.ts b/bin/copy-dist.ts index 67c3579a6..2505c31c3 100644 --- a/bin/copy-dist.ts +++ b/bin/copy-dist.ts @@ -1,5 +1,6 @@ import fs from "fs-extra"; import path from "path"; +import { execSync } from "node:child_process"; const DEST_DIR = "./build"; @@ -56,6 +57,9 @@ try { console.log("Copying complete!") + // TriliumNextTODO: for Docker this needs to run separately *after* build-stage + console.log("Pruning npm packages...") + execSync(`npm ci --omit=dev --prefix ${DEST_DIR}`); } catch(err) { console.error("Error during copy:", err) process.exit(1) diff --git a/bin/copy-trilium.sh b/bin/copy-trilium.sh index b80c97632..515c3ccc6 100755 --- a/bin/copy-trilium.sh +++ b/bin/copy-trilium.sh @@ -13,9 +13,6 @@ fi # Patch package.json main sed -i 's|./dist/electron-main.js|electron-main.js|g' "$BUILD_DIR/package.json" -# run in subshell (so we return to original dir) -(cd $BUILD_DIR && npm ci --omit=dev) - if [[ -d "$BUILD_DIR"/node_modules ]]; then # cleanup of useless files in dependencies for d in 'image-q/demo' \