This script is used by me to automate the obfuscation + build process for some of my electron apps
- Cleans your dist folder
- Obfuscates your JavaScript files in your selected source folders
- Checks for Dependencies in your package.json file which should be listed under dev-dependencies
- Builds the electron app with the local electron-builder installation
- Makes a hard git reset (So you can continue working with your non-obfuscated files)
Copy this file in your project and add it as script in your package.json, for example:
"scripts": {
"build": "node build/build.js"
},
Install the needed dependencies: javascript-obfuscator, fs-extra and electron-builder
Edit some variables to fit your environment/needs:
- dist folder (line 6)
- source folder list (line 14)
- javascript-obfuscator config (line 19 to 24)
- dev dependencies (line 31)
Run it with: npm run build win mac linux
And it will try to build for all 3 platforms, if it's possible (Only on mac AFAIK)
I am currently not working that much with electron anymore so don't expect any improvements, this is more an archive than anything else.
- Jonas Scholz - Code42Cate
This project is licensed under the MIT License