edit: I solved this by using electron-builder, it uses webpack under the hood so all problems are handled well by default. I post this question as I used electron-forge and electron-packager at first, and although I searched several resources I still couldn't wrap my head about the difference among electron-forge/electron-packager/electron-builder 😂
original question:
I built an electron app with electron-forge using react and typescript, but I found out it contains my whole typescript source code in the distribution.
After dug around, it seems that there's no way to get rid of the source, even asar
could be extracted easily. Minifying the source code may be the most "proper" way to keep others from just copy and paste my project. I figured may be I can achieve this by utilizing the afterCopy
hooks provided by electron-packager, but don't know how exactly I should do it, any suggestions?
You can use bytenode
for compiling all your js files into bytecode and it will be literally unreadable by humans. But it is quite hacky.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With