Currently, I am working on a small Electron application that utilizes Vue and TypeScript. While running the app in development mode, everything functions properly. However, when I build the app using Electron Builder, certain modules seem to disappear. Specifically, the modules adm-zip
and sudo-prompt
vanish during the build process. As a result, when the app is launched, an error occurs at these lines of code:
const AdmZip = window.require('adm-zip');
. Even after attempting to replace these modules with different ones, the issue persists. I suspect it may be related to webpack and TypeScript, but my lack of expertise in these areas leaves me uncertain.
Although other modules such as various Node packages and the electron-store
module are functioning correctly, I am struggling with finding a solution for this particular problem. Is this a common issue, and should I be importing the modules differently somehow? The standard methods like import
or require
do not work; instead, I have to use window.require
.
If you'd like to take a look at the repository, you can find it here: https://github.com/w3champions/w3champions-launcher on branch AddLauncherStuff