Install Electron and required packges
First of all, make sure you have installed Vue CLI:
1 | npm install -g @vue/cli |
Install Electron and Electron builder in your project:
1 | vue add electron-builder |
Update vue.config.js
Create or update vue.config.js
in the root of your project to include Electron Builder configuration.
1 | module.exports = { |
Update background.js
Electron builder will create a file named background.js
under the folder src
as the main file. Modify this file when needed.
1 | ; |
Run your electron app
Finally, run your Electron app with the following command:
1 | npm run electron:serve |
To build your app:
1 | npm run electron:build |