Vue-cli: Official Electron Support

Created on 24 Oct 2016  Â·  7Comments  Â·  Source: vuejs/vue-cli

Hey Vuejs Team!

I absolutely love Vue.js! And making desktop applications with Vue is even better. There are a couple of boilerplates out there, but electron-vue by @SimulatedGREG is by far the most popular and most maintained, with more than 400 stars it offers a variety of features including 1.x/2.x support.

Would you guys consider adding this as an official Electron template to the CLI?

discussion

Most helpful comment

That actually sounds like a great idea in my opinion. As much as I would love electron-vue to be recognized as an official template, it feels a little odd to have to transfer the repo to vuejs-templates. I think having something like vue search would be a much better option not only for me, but also to benefit the other awesome templates available within the community. And maybe some of those could be featured on the README.md of vue-cli, but that's not my decision to make.

All 7 comments

Hi @AkiraLaine !

If I see correctly, electron-vue does already support vue-cli.

[Edit] Ah sorry, you'd have it as official? Well, I think first to agree with that would need to be author @SimulatedGREG ... only thing would be that vue list would show this template...

Thanks for the shoutout @AkiraLaine !

I would be very grateful if electron-vue would be including within the official vue list. Not sure if that means I would need to update my template to be more like vuejs-templates/webpack, but it is heavily inspired by that structure.

That currently means it would need to be under vuejs-templates GitHub organization.

Maybe we could also add vue search command that would do something like:

https://api.github.com/search/repositories?q=vuejs-template+in:description (limited to GitHub) and we'd have a convention that one needs to use vuejs-template in their description to be listed under vue search…

That actually sounds like a great idea in my opinion. As much as I would love electron-vue to be recognized as an official template, it feels a little odd to have to transfer the repo to vuejs-templates. I think having something like vue search would be a much better option not only for me, but also to benefit the other awesome templates available within the community. And maybe some of those could be featured on the README.md of vue-cli, but that's not my decision to make.

Hey, I stumbled upon this issue with another thing in mind: I'd like to be able to run vue-cli-service serve --open --electron to start the application as an electron app. On the other hand, after all, electron should probably not a first class citizen in the vue cosmos. So I came up with another idea: Make a @vue/cli that will hook into vue-cli and start electron instead of a browser when installed. I am trying to accomplish this myself but it seems like this is not even possible with the current plugin API. What would be required would be to attach a listener to the listen method of the webpack-dev-server that opens electron and closes it when the dev server is being killed. This does not seem to be the case right now though.

@zigomir Would you guys be interested in a PR that exposes the dev server and made this possible?

I could also overwrite the serve command and invoke electron alongside the dev server myself 🤔

(as part of a plugin)

You can use the electron-builder plugin...

Was this page helpful?
0 / 5 - 0 ratings