I have an electron app and use electron-packager
for creating an executable that is used for a couple of days when the app is used. In my package.json it looks like this:
{
"name": "Software",
"version": "0.1.0",
"main": "main.js",
"devDependencies": {
"electron": "^6.0.9",
"electron-packager": "^14.0.6"
},
"dependencies": {
"chart.js": "2.8.0",
"deep-equal": "^1.1.0",
...
},
"scripts": {
"start": "electron .",
"pack-win": "electron-packager . Software --overwrite --asar --platform=win32 --arch=x64 --prune=true --out=dist",
"pack-linux": "electron-packager . Software --overwrite --asar --platform=linux --arch=x64 --prune=true --out=dist"
}
That works really fine, but I'd also like to minify my code automatically before packaging (without changing the original files of course), so that npm run pack-win
minifies the code and then directly builds my distribution version.
Does anybody know how I can achieve this?