Browse Source

替换热更新插件

Caner 2 years ago
parent
commit
e0548acfc1
2 changed files with 5 additions and 5 deletions
  1. 2 2
      package.json
  2. 3 3
      vite.config.ts

+ 2 - 2
package.json

@@ -31,7 +31,7 @@
     "socket.io-client": "^4.6.1",
     "typescript": "~5.0.4",
     "vite": "^4.3.6",
-    "vite-plugin-electron": "^0.12.0",
+    "vite-electron-plugin": "^0.8.2",
     "vite-plugin-eslint": "^1.8.1",
     "vite-plugin-svg-icons": "^2.0.1",
     "vue": "^3.3.2",
@@ -56,4 +56,4 @@
     "electronVersion": "25.3.0",
     "beforePack": "electron/beforePack.js"
   }
-}
+}

+ 3 - 3
vite.config.ts

@@ -3,7 +3,7 @@ import vue from '@vitejs/plugin-vue'
 import eslint from 'vite-plugin-eslint'
 import { resolve } from 'path'
 import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
-import electron from 'vite-plugin-electron'
+import electron from 'vite-electron-plugin'
 
 export default () => defineConfig({
   base: './',
@@ -21,8 +21,8 @@ export default () => defineConfig({
       symbolId: 'icon-[dir]-[name]'
     }),
     electron({
-      entry: 'electron/main.js',
-      vite: { build: { outDir: 'dist/electron/' } }
+      include: ['electron'],
+      outDir: 'dist/electron/'
     }),
   ],
   server: {