Closed zpinocchio closed 2 months ago
I have not tried webR in electron, but I think in theory this should work. When you start webR an options
argument can be passed of type WebROptions
. One of the settings here, baseUrl
allows you to set where the webR binaries are downloaded from.
To use a relative version of webR, rather than loading from CDN, first download and extract a webR release package (from https://github.com/r-wasm/webr/releases) somewhere onto your system so that it is available as a relative URL in electron. Let's say the relative directory is something like ./libs/webr/
.
Then, when you are loading webR set the baseUrl
option to point to this directory:
const webR = new WebR({
baseUrl: "./libs/webr/",
});
Thank you for your patience, your answers have helped me a lot!
electron has a main process and a render process. when the config like this:
nodeIntegration: true, contextIsolation: false,
i don't want load from CDN, just want plot some in render process.