-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nodeIntegration
and multiple windows
#21
Comments
https://github.com/electron-vite/vite-plugin-electron-renderer#config-presets-opinionated
By default Vite's configuration will take effect for each Multiple e.g. // scripts/build-renderer.mjs
import { build } from 'vite'
import renderer from 'vite-plugin-electron-renderer'
// foo.html
build({
plugins: [
renderer({ nodeIntegration: true }), // Enabled nodeIntegration
],
build: {
rollupOptions: {
input: 'foo.html',
},
},
})
// bar.html
build({
plugins: [
renderer(), // Disable nodeIntegration
],
build: {
rollupOptions: {
input: 'bar.html',
},
},
})
// -------------------------------------------------------------
// scripts/serve-renderer.mjs
// TODO: something If this is how you imagine it, I can try to provide a boilerplate project that can have separate |
Here 👉 multiple-window |
@caoxiemeihao Awesome! Sorry I've been quiet recently. I had a huge influx of Script Kit users and haven't been able to focus on the vite branch like I need to 😅 I promise to get back to it soon! |
@caoxiemeihao Where did that example go? |
@Andrew-web-coder updated |
Electron can have multiple
BrowserWindow
instances. Each of them can configurewebPreferences
and have different settings fornodeIntegration
.Since
nodeIntegration
is "per window", I don't know if it makes sense to have a global build setting fornodeIntegration
.The text was updated successfully, but these errors were encountered: