Closed alidcast closed 6 years ago
Hi @alidcastano
Actually next export
is the equivalent of nuxt generate
, but I believe server-side
rendering is pretty useless in an Electron app, and by forcing the mode: spa
, it will allow to avoid opening a port in production by serving the dist/
folder :)
[https://github.com/nuxt-community/electron-template/issues/19](Use registerStreamProtocol and nuxt.render)
git clone https://github.com/ddvjs/electron-test.git
cd electron-test
npm i
npm run dev
I do not want to use nuxt generate, because it is very troublesome, I hope to use registerStreamProtocol and nuxt.render
Can you simulate it like this?
I want to use nuxt.render to render registerStreamProtocol /ping @Atinux
Is there a solution to this approach?
Submitted a PR to serve /dist/electron for production hence no need to open port. https://github.com/nuxt-community/electron-template/pull/20 I know it is not using registerStreamProtocol, I don't have enough knowledge to figure it out, but this should be better than opening a port in production.
I closed the pull request as I found out the paths to the images do not work in production, either in /assets/img
or /static/img
.
Stumbled upon this article on how the Zeit team integrated Nex with Electron: https://leo.im/2017/electron-next
One consideration they mention is not to open a port in production due to security vulnerabilities:
I'm guessing
next export
is equivalent to running nuxt in--spa
mode. So perhaps similar considerations can be applied to this templatecc @Atinux