build: bundle sharp's win32-x64 prebuilt for Windows packaging
The packaged installer-rp crashed on launch with "Could not load the 'sharp' module using the win32-x64 runtime" because electron-builder ran on Linux and only the Linux sharp variants were present in node_modules. - Add `preinstall:sharp-win32` script that force-installs `@img/sharp-win32-x64@0.34.5` into the local node_modules (npm refuses it on Linux without --force due to its os/cpu restrictions). - Chain that script before both `dist:win` and `dist:win:rp` so future Windows builds always have the native prebuilt available. - Exclude `@img/sharp-{,libvips-}linux*` from the packaged files list in both electron-builder configs so the unused Linux variants don't bloat the portable exe. Verified `release/win-unpacked/resources/app.asar.unpacked/node_modules/ @img/sharp-win32-x64/lib/sharp-win32-x64.node` is present and that no linux sharp variants ship inside the asar. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,12 @@ files:
|
||||
- installer-rp/**
|
||||
- build/icon.*
|
||||
- package.json
|
||||
# sharp 는 플랫폼별 prebuilt 가 분리 패키지로 배포됨. Windows 빌드에서는
|
||||
# win32-x64 만 포함하고 linux/* 변종은 묶지 않아 exe 크기를 줄임.
|
||||
- "!node_modules/@img/sharp-linux-*"
|
||||
- "!node_modules/@img/sharp-linuxmusl-*"
|
||||
- "!node_modules/@img/sharp-libvips-linux-*"
|
||||
- "!node_modules/@img/sharp-libvips-linuxmusl-*"
|
||||
# 메인 설치기와 동일하게 빌드 전용 `.env.build` 와 locales 를 함께 배포.
|
||||
extraResources:
|
||||
- from: .
|
||||
|
||||
Reference in New Issue
Block a user