1 year ago
#379938
Mitchell Day
electron-packager start command
I was wondering if anyone knows how I can define the command used for the packaged electron app. I have a command to package the app using electron-packager, but how do I define what script, or file that the packaged app should start?
"scripts": {
"start": "node server.js",
"desktop": "set SERVER_MODE=secure&& electron app.js",
"bcrypt_win": "install bcrypt",
"bcrypt_linux": "wsl sudo install bcrypt",
"buildwin": "electron-packager . VT2_Server --overwrite --platform=win32 --arch=x64 --icon=client/data/media/vt2_android.png --prune=true --out=../builds",
"buildlinux": "electron-packager . vt2server --overwrite --platform=linux --arch=x64 --icon=client/data/media/vt2_android.png --prune=true --out=../builds",
"buildmac": "electron-packager . VT2_Server --overwrite --platform=darwin --icon=data/media/server.ico --prune=true --out=../builds",
"buildall": "electron-packager . VT2_Server --overwrite --platform=all --icon=data/media/server.ico --prune=true --out=../builds",
"deb64_wsl": "wsl sudo electron-installer-debian --src ../builds/vt2server-linux-x64/ --arch amd64 --config debian.json",
"deb64": "electron-installer-debian --src ../builds/vt2server-linux-x64/ --arch amd64 --config debian.json",
"linuxBuildAndPackage": "npm run buildlinux && npm run deb64_wsl"
}
In this instance I want the electron-packager to make "npm run desktop" the start script for the packaged application.
Reason being is I have this start as a desktop application which starts the app.js and uses the SERVER_MODE to define the express server type. But I want to be able to start it in a server mode for docker servers.
Is that possible?
npm-scripts
electron-packager
0 Answers
Your Answer