Handle light vs deep integration of Electron
With the current implementation of electron-wrapper, launching the command quasar wrap electron simply creates a project structure to launch an Electron shell and executing the packaged application inside of it without deep integration (no access to Electron's renderer API).
I imagine two ways to solve this issue:
- Add option to set
lightvsdeepElectron integration toquasar wrap electroncommand (quasar wrap electron --deep/light). - Make
quasar dev/buildcommands on project root folder (notelectron/) more explicit, in order to better handle Electron integration (quasar dev/build electron --deep/lightinstead of previousquasar dev)
In both cases, with deep integration I mean changing or adding to the webpack conf the target electron-renderer and electron package in dependencies inside package.json of root project. With light integration I mean the current mode (just Electron shell executing an URL without accessing to Electron API).
My personal choice would be no.2, because it should allow us to change dynamically the webpack config to handle both cases without changing code, so that the same codebase could be used for browser (quasar dev/build), Electron (quasar dev/build electron) or Cordova (quasar dev/build cordova).
I noticed that current implementation of electron-wrapper does not allow (by default) that I use Node.js Libraries (ex.: File System) inside my components. A deep integration will help with this limitation ?
@lucascampelo, although it has been two months I thought I'd still reply. Yes, setting 'target: electron-renderer' will allow usage of File System. As the suggested deep integration adds this target it would solve the problems. I think however it is better to have a separate webpack file as it still allows browser version's and use try-catch to check for 'fs' availability.