Files
minecraft_launcher/package.json
claude-bot 40c47fbeb3 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>
2026-05-18 02:14:55 +09:00

39 lines
1.5 KiB
JSON

{
"name": "minecraft-music-quiz-installer",
"version": "0.1.0",
"description": "마인크래프트 음악퀴즈 간편설치기 + 관리 사이트",
"main": "dist/installer/main.js",
"scripts": {
"build": "tsc -p tsconfig.json",
"start": "tsc -p tsconfig.server.json && node dist/server/app.js",
"dev:server": "tsc -p tsconfig.server.json && node dist/server/app.js",
"installer": "tsc -p tsconfig.installer.json && electron .",
"installer:rp": "tsc -p tsconfig.installer-rp.json && electron dist/installer-rp/main.js",
"preinstall:sharp-win32": "npm install --no-save --force @img/sharp-win32-x64@0.34.5",
"dist:win": "npm run preinstall:sharp-win32 && tsc -p tsconfig.installer.json && electron-builder --win --config electron-builder.yml",
"dist:win:rp": "npm run preinstall:sharp-win32 && tsc -p tsconfig.installer-rp.json && electron-builder --win --config electron-builder-rp.yml"
},
"dependencies": {
"@types/archiver": "^7.0.0",
"archiver": "^7.0.1",
"dotenv": "^17.4.2",
"ejs": "^3.1.10",
"express": "^4.19.2",
"express-session": "^1.18.0",
"extract-zip": "^2.0.1",
"multer": "^1.4.5-lts.1",
"nat-upnp": "^1.1.1",
"sharp": "^0.34.5"
},
"devDependencies": {
"@types/ejs": "^3.1.5",
"@types/express": "^4.17.21",
"@types/express-session": "^1.18.0",
"@types/multer": "^1.4.11",
"@types/node": "^22.5.0",
"electron": "^31.4.0",
"electron-builder": "^24.13.3",
"typescript": "^5.5.4"
}
}