-
-
Notifications
You must be signed in to change notification settings - Fork 599
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
[commonjs] - should not compile require #342
Comments
Your issue was caused by #206 where behaviour was changed to also process "Webpack style". mixed modules. To me, your use case looks important and I would assume to add a switch, e.g. |
A kill switch is also acceptable. I think we can be smarter and actually choose our behavior on the fly, but a kill switch will allow more fine-grained control. I would like to actually have proper tests in place for these use cases which rollup probably never considered before... |
If there are some ideas how we can make Electron support even smarter, that would be great because I think there are more and more people who have this use-case. So to my understanding in an Electron application you have like two kind of processes, a "main process" and one or more "render processes". A render process is just a regular Web page and would very much profit from being bundled as ESM. However, Electron injects a global variable Not sure if the browser could even |
@lukastaegert To avoid |
True, the problem is that the frontend code can still have CJS dependencies. So of course what you can do is fine-tune your include/exclude options to only target e.g. node_modules, but looking at the other issue I think there would be more use for an option to ignore mixed modules. |
…llup#348, rollup#342) `transformMixedEsModules = false`
BREAKING CHANGE: Reverts default behavior of mixed es and cjs modules. Marked as a "breaking change", but the PR that raised this need was actually a breaking change for people who did not utilize include/exclude correctly and have variety of dependencies with mixed UMD mechanisms. * Implemented kill-switch for mixed commonjs in mixed es-cjs (Closes #348, #342) `transformMixedEsModules = false` * Update packages/commonjs/README.md Co-authored-by: Andrew Powell <[email protected]> * Update index.d.ts Co-authored-by: Andrew Powell <[email protected]>
Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it.# Comment to post when closing a stale issue. ⓘ |
BREAKING CHANGE: Reverts default behavior of mixed es and cjs modules. Marked as a "breaking change", but the PR that raised this need was actually a breaking change for people who did not utilize include/exclude correctly and have variety of dependencies with mixed UMD mechanisms. * Implemented kill-switch for mixed commonjs in mixed es-cjs (Closes rollup#348, rollup#342) `transformMixedEsModules = false` * Update packages/commonjs/README.md Co-authored-by: Andrew Powell <[email protected]> * Update index.d.ts Co-authored-by: Andrew Powell <[email protected]>
How Do We Reproduce?
npm i
)npm run dev
)Expected Behavior
Should not compile
require
syntax, but only es6 syntaxes (e.gimport
,export
), or simply when we precise it to rollup. It should works fine withnodeIntegration
of ElectronJS. It worked fine before I did aupgrade latest
command, and now it doesn't work anymore.Actual Behavior
In the console:
The text was updated successfully, but these errors were encountered: