

-
I'm honestly not overly familiar with the "typical" setup of an Electron app (if there is such a thing — the docs make it sound pretty open-ended). I've only ever used it in the context of nx-electron (not that I can recommend it — it's not up-to-date with the latest versions of nx/Angular and it's kind of harrowing to get working even in the best case). But not being able to import anything in your entry-point seems like an unusual constraint — how are you bootstrapping the application?
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
In any event, I just took a closer look at my project, and it looks like the key thing is to wait for Electron's ready event before registering the ipcMain listeners. So, taking Electron's quick-start example as a starting point, you would want to do it in the app.whenReady().then(() => { ... }) callback, probably just before creating the window. Does that help?
-
nx
Build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
It's hard to know for sure without doing a deep-dive on your repo, but it sounds like you're not using a bundler for your Electron project. Honestly, if the Electron part of your app is pretty lightweight, I wouldn't even worry about it — if it ain't broke, don't fix it. :) If at some point this starts to feel excessively limiting, you could either look into setting up a custom build system for your Electron app (i.e., via Rollup or Parcel or Webpack, etc.) or look into migrating to Nx and using the nx-electron plugin I mentioned earlier (as long as you're on Angular <= v11). But either of those options open a huge can of worms — if you don't have a lot of experience with bundling/building JS applications, it is quite a deep rabbit hole to dive into.