-
Notifications
You must be signed in to change notification settings - Fork 200
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
rollup uses require() with multiple inputs #58
Comments
May be neet remove the following options. electron-vite-react/vite.config.ts Line 48 in 63cef88
This options will cause Rollup to build code in cjs format. 👉 Config presets (Opinionated)After removing this option, Rollup will use the esm format to build the code by default, which can avoid the require in the bundle code.
|
Unfortunately, some of Electrons scripts use Edit: I am using
Edit2: Seems I can work around this by making Bottom line: It would be nice if multiple entry points also worked with the electron-vite-renderer module. |
In fact, if // e.g. renderer.js
const { nativeTheme } = require('electron')
// Uncaught ReferenceError: require is not defined |
Now |
When building an app with multiple inputs:
rollup automatically creates a shared
app.<hash>.js
file with all the common modules and requires it from both entry files.However with Electron properly configured,
require
is not available in the renderer, so the app doesn't work. What is the correct way to make this work, either by inlining the common modules in both (larger file size) or selectively allowing require (I'd rather not?).The text was updated successfully, but these errors were encountered: