Closed raphael10-collab closed 1 year ago
That looks correct. The index.js file is the loader file. It basically just loads the .jsc file. Is any of your original code contained in the .js file? It should all be compiled into the .jsc file. Electron has no way to load .jsc files, so Bytenode gets loaded through small .js files which basically just require()
the .jsc file. It may look more complicated after running through Webpack, but none of your original code should be in there.
Thank you @jjeff
Looking forward to an example without node integration: https://github.com/herberttn/bytenode-webpack-plugin/issues/28
Bytenode always requires Node to work. It will not work in an Electron renderer script without Node enabled. However, Node is always enabled in Electron preload scripts (which have access to the renderer scope). So a good practice is to have all of your Bytenode compiled code in your preload scripts.
Hi @jjeff
I've explained what I've done here: https://github.com/herberttn/bytenode-webpack-plugin/issues/30#issuecomment-1703033897
What should I practically add to the above preload.ts code in order to have my all Bytonode compiled code within preload.ts ?
Example taken from here: https://github.com/herberttn/bytenode-webpack-plugin/tree/main/examples/electron-forge-typescript-webpack
electron forge make
yields both a compiled file and a "plain text" file:Once I remove the plain text file:
the executable does not work anymore :
So... may be I'm missing something...
because I do not understand the benefit and usefulness of producing a JS BInary, if without the plain text file, which is supposed to be removed if we want to hide the plain JS code, the executable does not work