From 43e79dec04e856347ce5e8022c444351f1c2dcfe Mon Sep 17 00:00:00 2001 From: 7418 <7418@openclaw.ai> Date: Fri, 6 Feb 2026 21:48:43 +0800 Subject: [PATCH] fix: ensure standalone node_modules are included in packaged app - Split extraResources to explicitly copy node_modules separately (electron-builder excludes node_modules by default) - Exclude unnecessary project files from asar bundle - Fixes 'Cannot find module next' error in packaged app Co-Authored-By: Claude Opus 4.6 --- electron-builder.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/electron-builder.yml b/electron-builder.yml index 1e79b4b..5fd069d 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -4,12 +4,25 @@ directories: output: release files: - dist-electron/**/* - - .next/standalone/**/* - - .next/static/**/* - - public/**/* + - "!node_modules" + - "!src" + - "!electron" + - "!.next" + - "!build" + - "!scripts" + - "!docs" + - "!release" extraResources: - from: .next/standalone/ to: standalone/ + filter: + - "**/*" + - "!node_modules" + - from: .next/standalone/node_modules/ + to: standalone/node_modules/ + filter: ["**/*"] + - from: .next/standalone/.next/ + to: standalone/.next/ filter: ["**/*"] - from: .next/static/ to: standalone/.next/static/