caoxiemeihao / nuxt-electron

Integrate Nuxt and Electron
MIT License
184 stars 21 forks source link

How do I use this project with a preload script? #41

Closed itsrachelfish closed 1 year ago

itsrachelfish commented 1 year ago

I am trying to use IPC to communicate between my main electron process and the render process. https://www.electronjs.org/docs/latest/tutorial/ipc

I cannot find any documentation about how to use a preload script with nuxt-electron. Any help would be appreciated

caoxiemeihao commented 1 year ago

Hey! Maybe the quick-start is better for you.

https://github.com/caoxiemeihao/nuxt-electron/blob/v0.6.0/examples/quick-start/nuxt.config.ts#L10-L15

image

BTW, nuxt-electron just a wrapper, it's based on vite-plugin-electron

Full build option define here: 👉 https://github.com/caoxiemeihao/nuxt-electron/blob/v0.6.0/src/index.ts#L39 👉 https://github.com/electron-vite/vite-plugin-electron#api-define