File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { rmSync } from 'fs'
22import { defineConfig } from 'vite'
33import vue from '@vitejs/plugin-vue'
44import electron from 'vite-electron-plugin'
5- import { customStart } from 'vite-electron-plugin/plugin'
5+ import { customStart , loadViteEnv } from 'vite-electron-plugin/plugin'
66import renderer from 'vite-plugin-electron-renderer'
77import pkg from './package.json'
88
@@ -17,10 +17,16 @@ export default defineConfig({
1717 transformOptions : {
1818 sourcemap : ! ! process . env . VSCODE_DEBUG ,
1919 } ,
20- // Will start Electron via VSCode Debug
21- plugins : process . env . VSCODE_DEBUG
22- ? [ customStart ( debounce ( ( ) => console . log ( /* For `.vscode/.debug.script.mjs` */ '[startup] Electron App' ) ) ) ]
23- : undefined ,
20+ plugins : [
21+ ...( process . env . VSCODE_DEBUG
22+ ? [
23+ // Will start Electron via VSCode Debug
24+ customStart ( debounce ( ( ) => console . log ( /* For `.vscode/.debug.script.mjs` */ '[startup] Electron App' ) ) ) ,
25+ ]
26+ : [ ] ) ,
27+ // Allow use `import.meta.env.VITE_SOME_KEY` in Electron-Main
28+ loadViteEnv ( ) ,
29+ ] ,
2430 } ) ,
2531 // Use Node.js API in the Renderer-process
2632 renderer ( {
You can’t perform that action at this time.
0 commit comments