Skip to content

Electron support #825

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

Closed
antoniogiroz opened this issue Feb 11, 2018 · 9 comments
Closed

Electron support #825

antoniogiroz opened this issue Feb 11, 2018 · 9 comments

Comments

@antoniogiroz
Copy link

What problem does this feature solve?

Create an appropriate folder structure for electron app allow to launch the 'main' process after 'renderer' process build has finished.

Also add vue-electon.

What does the proposed API look like?

Add this option in create command wizard

@yyx990803
Copy link
Member

Out hope is that this can be done by the community in the form of a plugin.

/cc @SimulatedGREG since he's been doing a great job on electron-vue. We are curious to know if the current API has any road blocks for implementing the plugin.

@SimulatedGREG
Copy link

SimulatedGREG commented Feb 12, 2018

I've been pretty busy with work items at the moment, but already have been diving into the docs that were posted a few days ago. Don't have any PoCs just yet, but it looks very promising. This is something I definitely don't want to rush out, so it'll take some time. I'll be sure to post my findings here if I find any road blocks come about.

@nklayman
Copy link

I've created vue-cli-plugin-electron-builder. It sets up electron-webpack and electron-builder, with build and serve commands. I hope this solves this issue.

@SimulatedGREG
Copy link

Planning to dive more into this at the end of the month, but I did find one item that I feel could be changed to better benefit third-party plugins. Currently, the webpack development server setup that comes internally with @vue/cli is phenomenal and really sets a great standard for all Vue applications, but it is currently locked to the serve command and can't be further customized.

module.exports = (api, options) => {

I propose that the logic for setting up the development server, or at least the produced webpack-dev-server configuration object somehow be exposed in its own file, therefore allowing third-party plugins to make use of the configuration and further customize as needed.

For the purposes of electron-vue, it is a bit of a pain to recreate a development server when there are not very many differences between the internally provided development server. This would not only help my purposes, but I'm sure there are many other situations where third-party plugins could greatly benefit from this.

@nklayman
Copy link

@SimulatedGREG why don't you just start the built-in development server, and then launch electron and have it load the render process from the development server? Then you would have all the features of the built in server like hot module reload without having to rewrite the code yourself. I am actively working on an implementation of this in a future version of vue-cli-plugin-electron-builder. What I am currently stuck on is modifying the base webpack build config for electron, but this is only required for building, not the dev server.

@antoniogiroz
Copy link
Author

I've created vue-cli-plugin-electron-builder. It sets up electron-webpack and electron-builder, with build and serve commands. I hope this solves this issue.

@nklayman I've stated to use your plugin, it's great! thanks!

@nklayman
Copy link

@SimulatedGREG I created this PR which allows the build/serve commands to be imported and called with a custom webpack config. [email protected] uses the custom cli-service of the PR. It imports the build/serve commands and calls them with a modified webpack config that works with electron.

@solarhell
Copy link

@nklayman LGTM

@mathe42
Copy link

mathe42 commented Aug 15, 2018

Hi,

just read https://v6.electronforge.io/plugins/webpack (in beta) this seems to be easy with vue-cli...

and you have the complete electron-forge api...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants