mirror of
https://github.com/UiO-Gaming/infoscreen3.git
synced 2026-11-05 13:56:52 +01:00
- Updated package.json to replace pkg with nexe for building executables. - Added rebuild-native-node20.js for rebuilding native modules for Node.js 20.18.1. - Introduced test-exe.js to facilitate testing of the generated executable. - Modified webpack.config.cjs to output bundle.cjs and set libraryTarget to commonjs2. - Enhanced profiler plugin for memory usage tracking with simplified output. - Removed unused dependencies and updated existing ones in package.json.
1.9 KiB
1.9 KiB
BUILD
Prerequisites
- Install build tool globally (choose one):
- pkg:
npm i pkg -g(Node 18 max, deprecated) - nexe:
npm i nexe -g(Node 20+, actively maintained)
- pkg:
- Install dependencies:
npm install
Build Executable
Using Nexe (Recommended - Node 20 support)
Quick Build (Current Platform):
npm run build:nexe
Cross-Platform Build (Windows + Linux):
npm run build:nexe
This will create platform-specific packages in dist/ with all necessary files:
dist/windows-x64/- Windows executable and runtime filesdist/linux-x64/- Linux executable and runtime files
Using pkg (Legacy - Node 18 max)
Quick Build (Current Platform):
npm run build
Cross-Platform Build (Windows + Linux):
npm run build:cross
Platform-Specific Builds
Build only for Windows:
npm run build:windows
Build only for Linux:
npm run build:linux
SQLite3 Native Module
If you encounter issues with SQLite3 bindings:
- Rebuild for current platform:
npm run rebuild:sqlite
- For cross-platform builds, you may need to:
- Build on the target platform, OR
- Manually copy the appropriate
.nodebindings tonode_modules/sqlite3/build/Release/
Troubleshooting
Missing native bindings
If the executable fails with "Cannot find module", ensure sqlite3 native bindings are included:
npm rebuild sqlite3 --build-from-source
npm run build:cross
Windows Defender / Antivirus
Packaged executables may be flagged. Add an exception for the dist folder.
Distribution
Each platform package in dist/ is self-contained and includes:
- Executable binary
- Data directories (data, locales, templates, tmp, trash)
- Sample .env configuration
- README with platform-specific instructions