-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Electron support via a plugin #10341
Comments
There's https://github.com/electron-vite/electron-vite-vue and I don't think it's immature. Electron support in Vite also isn't a configuration away, there are actual caveats Vite doesn't support due to Electron's nature of mixing both node and browser code. For example: #7821 |
Hey @bluwy. Thanks for answering so quickly. I've been mainly experimenting with https://github.com/electron-vite boilerplates and the Yep, you are right, it's not a configuration away. There needs to be a plugin for that. I realize it's not simple. I think I've oversimplified it in my initial explanation. One of Vite's core values is simple configuration. Electron is hard to configure even with the already available plugin. We've struggled a lot with Webpack and I don't want to repeat the same mistakes. Have you had any internal conversations about supporting Electron? It would be useful to know because I would be able to plan a little better. We will move to Vite regardless of this but I feel uncertainty on the other path. Also, I see an opportunity to make this easy for a lot of other people. |
I kept thinking about this. What if you invite the people working on https://github.com/electron-vite to join Vite and move their repos here? They really might be close to being mature. If that's the case, this will be a win for the Electron community who will feel confident to rely on Vite. You will also be able to give them a little guidance on how the configuration can be simpler and the documentation a little clearer. That's just a hypothetical that might spring new ideas. I hope I don't go overboard with these comments. 🙏 |
We have a
Following my previous point, we don't have experience with Electron so moving it into core is hard for us to maintain. It might even slow down the development as PRs and releases have to be done by us. We currently do support ecosystem maintainers on discord though so there's direct communication with the core team. I think that's the best way forward. I'm not sure if @caoxiemeihao is in discord but we can definitely arrange an ecosystem role! |
Regarding the last question you mentioned, I am Debugging on the Vite source code, and it should be found out by me soon. 🐥 @bluwy 👋
I am honored to be in the role of ecosystem maintainer. 😄 |
Thanks for your efforts @caoxiemeihao on getting Electron support working! You can join http://chat.vitejs.dev (if you're not already in) and ping Closing this for now as we're not planning on first-class Vite plugin for Electron. |
Yep, this makes sense. If none of you use/understand Electron it's not viable. Please keep in mind this thread for the future. At some point, a new member can join that understands it. Electron isn't a small niche. Most people program on an Electron app (VSCode) and the GitHub repo has 104k stars.
That is indeed great and will make it easier for Electron developers to choose https://github.com/electron-vite. @caoxiemeihao you can even mention your role in your repos readmes. |
Description
For weeks now I've been struggling to move our Electron app to Vite.
When building for the Electron renderer process you need to handle: node imports,
node:
imports, node native modules, node globals,electron
imports,electron
imports in Web Workers. There are more, I just don't understand enough to list them.If dev mode works, the build may not work (and vice-versa).
Suggested solution
I suggest Vite adds support for Electron via a plugin.
I realize that may be out of scope at least for now but at least people can find this issue and see a comment from the maintainers so they can decide on their next steps.
I will also share any significant progress I have in the comments.
Alternative
An open-source plugin/boilerplate by non-Vite maintainers could be a solution. There are currently some projects but I don't consider them mature — hard to work with, don't support a use case, and have bugs.
Additional context
I want to provide an overview of what I'm proposing:
Vite doesn't have any limitations for supporting Electron, it comes down to configuration. The Vite team is probably the most knowledgeable about what that configuration should be. I think it would be great for people to not spend a lot of time configuring Electron projects.
Validations
The text was updated successfully, but these errors were encountered: