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 <noreply@anthropic.com>
This commit is contained in:
7418andClaude Opus 4.6 committed 2026-02-06 21:48:43 +08:00
1 parent 37e5e4ed71
commit 43e79dec04
1 file changed
+16 -3
+16 -3
View File
@@ -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/