Pacakging Electron-Eel
My steps:
- Download source folder:08 - Eelectron-quick-start;
- Enter the folder, and install dependencies:
yarn install;(yarncommand need:npm install yarn -g) - Add
electron-builderdevDependencies:yarn add electron-builder --dev; - Modify
scriptsin filepackage.json:"dist": "electron-builder --ia32"; (--ia32can be ignored) - Package Electron:
yarn run dist;(Then generated folder./dist/win-ia32-unpacked, and theEelectron-quick-start.exefile inwin-ia32-unpackedis an Electron executable as browser container) - Modify the options in file
hello.py:'args': ['win-ia32-unpacked/Eelectron-quick-start.exe', '.']; - Install Python library
Pyinstaller:pip install Pyinstaller; - Package Eel:
python -m eel hello.py web --onefile --noconsole; (Generated the single executable filehello.exeindistfolder)
- The final generated files is a folder
win-ia32-unpackedand a filehello.exe; (Both in the same folder) - The
hello.exeis launcher of the project. - Eel as a server, Electron as a browser. Eel serve the web, and run the Electron; Electron access Eel server.
- Disk usage: folder
win-ia32-unpacked127M; filehello.exe27M; zip (win-ia32-unpackedandhello.exe) 82M. - Memory usage:
Eelectron-quick-start.exe42M;hello.exe13M.
So, anyone else have a better idea about packaging the Electron-Eel?
Since the electron-builder provides packaging and distributing. I think electron-builder should be the step after pyinstaller.
The 'options' looks deprecated cz it shows me error. So I used the following in my hello.py:
eel.start ('index.html', mode='custom', cmdline-args='path/to/electron/exe/in/node_modules',['.']')
But how can I package the electron-eel app if i use this config?
The 'options' looks deprecated cz it shows me error. So I used the following in my hello.py:
eel.start ('index.html', mode='custom', cmdline-args='path/to/electron/exe/in/node_modules',['.']')But how can I package the electron-eel app if i use this config?
I was able to package it using python -m eel --add-data="main.js;." --add-data="node_modules;node_modules" --add-data="package-lock.json;." --add-data="package.json;." --noconfirm main.py web
but when I try use --onefile I get this error when executing the exe :v
