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>
39 lines
1.4 KiB
YAML
39 lines
1.4 KiB
YAML
appId: kr.tkrmagid.musicquiz.installer
|
|
productName: MusicQuizInstaller
|
|
directories:
|
|
output: release
|
|
buildResources: build
|
|
files:
|
|
- dist/installer/**
|
|
- dist/shared/**
|
|
- installer/**
|
|
- 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` 를 설치기 옆에 함께 배포(없으면 조용히 패스).
|
|
# `.env` 는 서버/개발 실행용이라 빌드 산출물에는 포함되지 않으며, 패키지된 exe
|
|
# 는 `resources/.env.build` 를 우선 로드함(없으면 `resources/.env` 로 폴백).
|
|
# 패키징 후 운영자가 `resources/.env.build` 만 교체해서 도메인을 바꿀 수 있음.
|
|
# locales/ 폴더는 i18n.ts 가 process.resourcesPath/locales/<component>/ko-kr.json
|
|
# 을 찾아 로드하므로, 빌드된 .exe 에서도 한국어 사전이 적용되도록 함께 배포.
|
|
extraResources:
|
|
- from: .
|
|
to: .
|
|
filter:
|
|
- .env.build
|
|
- from: locales
|
|
to: locales
|
|
filter:
|
|
- "**/*"
|
|
win:
|
|
target: portable
|
|
artifactName: ${productName}-${version}-Portable.${ext}
|
|
icon: build/icon.ico
|
|
portable:
|
|
artifactName: ${productName}-${version}-Portable.${ext}
|