Browse Source

替换热更新插件

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

+ 1 - 1
package.json

@@ -26,7 +26,7 @@
     "sass": "^1.63.3",
     "sass": "^1.63.3",
     "typescript": "~5.0.4",
     "typescript": "~5.0.4",
     "vite": "^4.3.6",
     "vite": "^4.3.6",
-    "vite-plugin-electron": "^0.12.0",
+    "vite-electron-plugin": "^0.8.2",
     "vite-plugin-eslint": "^1.8.1",
     "vite-plugin-eslint": "^1.8.1",
     "vite-plugin-svg-icons": "^2.0.1",
     "vite-plugin-svg-icons": "^2.0.1",
     "vue": "^3.3.2",
     "vue": "^3.3.2",

+ 3 - 2
vite.config.ts

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