File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 2020 "typescript" : " ^4.8.4" ,
2121 "vite" : " ^3.1.4" ,
2222 "vite-electron-plugin" : " ^0.4.6" ,
23+ "vite-plugin-electron-renderer" : " ^0.10.1" ,
2324 "vue" : " ^3.2.40" ,
2425 "vue-tsc" : " ^0.40.13"
2526 },
Original file line number Diff line number Diff line change 11import { createApp } from 'vue'
22import App from './App.vue'
3-
4- /**
5- * If you enables use of Node.js API in the Renderer-process
6- * ```
7- * npm i -D vite-plugin-electron-renderer
8- * ```
9- * @see - https://github.com/electron-vite/vite-plugin-electron/tree/main/packages/electron-renderer#electron-renderervite-serve
10- */
11- // import './samples/node-api'
3+ import './samples/node-api'
124
135createApp ( App )
146 . mount ( '#app' )
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { defineConfig } from 'vite'
33import vue from '@vitejs/plugin-vue'
44import electron from 'vite-electron-plugin'
55import { customStart } from 'vite-electron-plugin/plugin'
6+ import renderer from 'vite-plugin-electron-renderer'
67import pkg from './package.json'
78
89rmSync ( 'dist-electron' , { recursive : true , force : true } )
@@ -21,6 +22,10 @@ export default defineConfig({
2122 ? [ customStart ( debounce ( ( ) => console . log ( /* For `.vscode/.debug.script.mjs` */ '[startup] Electron App' ) ) ) ]
2223 : undefined ,
2324 } ) ,
25+ // Use Node.js API in the Renderer-process
26+ renderer ( {
27+ nodeIntegration : true ,
28+ } ) ,
2429 ] ,
2530 server : process . env . VSCODE_DEBUG ? ( ( ) => {
2631 const url = new URL ( pkg . debug . env . VITE_DEV_SERVER_URL )
You can’t perform that action at this time.
0 commit comments