breautek commented on issue #279:
URL: 
https://github.com/apache/cordova-electron/issues/279#issuecomment-2236450874

   Like all platforms, everything inside `platforms/` is cordova managed and 
generated. Manually making modifications to any files within may get destroyed 
by cordova's prepare or build process.
   
   It is possilbe to extend cordova's prepare/build processes via 
[Hooks](https://cordova.apache.org/docs/en/12.x/guide/appdev/hooks/index.html) 
and script a modification to a file. E.g. most platform files are generated 
during the `prepare` phase, therefore the `after_prepare` hook can usually be 
used to make a further modification _after_ Cordova has generated files.
   
   Replacing `cdv-electron-main.js` is however not recommended. This is the 
main file for electron which Cordova implements the Cordova framework, manages 
plugins and exposes plugin APIs via context isolation. Replacing the file 
entirely would mean disabling all the cordova bits. So forcing this file as a 
main I believe is necessary and will be the reason I'm closing the ticket. If 
this is what you want to do, then you'll be honestly better of using electron 
directly. Using the hooks mentioned above, it is possible to manipulate this 
file however if necessary.
   
   The electron NodeJS environment is akin to the Android's native java 
environment, or iOS's native objective-c environment. They are abstracted from 
app development. Typically these environments are exposed to the application's 
webview via an interface implemented by plugins. Electron platform is no 
exception to this. We don't have an explicit electron plugin guide at this 
time, but the [device 
plugin](https://github.com/apache/cordova-plugin-device/tree/master/src/electron)
 is a simple plugin to see how it exposes an API.
   
   Further Reading:
   - [Cordova 
Architecture](https://cordova.apache.org/docs/en/12.x/guide/overview/index.html)
   - [Cordova Electron App 
Development](https://cordova.apache.org/docs/en/12.x/guide/platforms/electron/index.html)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to