bennymeg / nx-electron

Electron schematics for nrwl nx platform
Apache License 2.0
328 stars 85 forks source link

Any plan to support bundle with vite #215

Closed vuggy17 closed 1 year ago

vuggy17 commented 1 year ago

Is your feature request related to a problem? Please describe. Vite is faster, and there is a plugin that can be used to simplify the complex of manage ipcs interface, take a look at this repo he use this plugin to manage ipc exposes.

Describe the solution you'd like I would like the library to provide an option to bundle with Vite. This could be implemented by adding a new configuration option or flag that allows users to choose between bundling with Webpack or Vite. Like nx-react plugin: nx create-app myapp --bundler=vite

Describe alternatives you've considered

Additional context Thank you for considering this feature request.

bennymeg commented 1 year ago

Sure, I'll be happy to receive a PR. All is needed to do is:

  1. Add a new file similar to this one in vite.
  2. Add an option to select the bundler like here.
WillPoulson commented 1 year ago

@bennymeg I'm wondering how crazy it would be to migrate to electron-forge to deal with the compiling work. But I suppose that would dirty this project into nx-electron-forge more than a base nx-electron

Forge supports both webpack and vite and if we could integrate it into nx executors that might remove quite a lot of heavy lifting this package has to do.

What are your thoughts on this?

Ignoring the above, electron-vite would seem like a good path to go down if we wanted to leave the webpack work as is, and create a new executor for just vite.

bennymeg commented 1 year ago

@WillPoulson I did not have a good experience with electron-forge in the past for complex applications. But a long time has pass and it seems that electron adopted them as their build tool so it might have changed. It wouldn't be a small task so we will need to understand in depth what we will gain and loose from it.

Regarding 'electron-vite', sure, @nx/vite might be a good solution as well.