resolved: I was able to solve this issue using electron-builder, which utilizes webpack in the background to handle all problems efficiently. Initially, I faced this challenge while using electron-forge and electron-packager. Despite researching extensively, I struggled to comprehend the distinction among electron-forge/electron-packager/electron-builder 😂
initial inquiry:
I developed an electron application with electron-forge, incorporating react and typescript, only to discover that my entire typescript source code is included in the distribution.
Upon further investigation, it appears that there is no straightforward way to eliminate the source code, as even asar
can be easily extracted. Minimizing the source code may be the most effective strategy to prevent others from simply copying and pasting my project. I thought that I might achieve this by leveraging the afterCopy
hooks provided by electron-packager, but I am uncertain about the specific steps involved. Any recommendations?