Configuring Electron
We’ll be using Quasar CLI to develop and build an Electron App. The difference between building a SPA, PWA, Mobile App or an Electron App is simply determined by the “mode” parameter in “quasar dev” and “quasar build” commands.
But first, let’s learn how we can configure the Electron build.
Quasar.conf.js
You may notice that /quasar.conf.js
contains a property called electron
.electron: {
// optional; webpack config Object for
// the Main Process ONLY (/src-electron/main-process/)
extendWebpack (cfg) {
// directly change props of cfg;
// no need to return anything
},
// optional; EQUIVALENT to extendWebpack() but uses webpack-chain;
// for the Main Process ONLY (/src-electron/main-process/)
chainWebpack (chain) {
// chain is an webpack-chain instance
// of the Webpack configuration
},
bundler: 'packager', // or 'builder'
// electron-packager options
packager: {
//...
},
// electron-builder options
builder: {
//...
}
}
The “packager” prop refers to electron-packager options. The dir
and out
properties are overwritten by Quasar CLI to ensure the best results.
The “builder” prop refers to electron-builder options.