feat: support use electron Renderer-process
This commit is contained in:
1 parent
4deedc6b22
commit
effddb2c03
1 file changed
+7
@@ -1,6 +1,7 @@
|
|||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import react from '@vitejs/plugin-react'
|
import react from '@vitejs/plugin-react'
|
||||||
|
import resolve from 'vite-plugin-resolve'
|
||||||
import pkg from '../package.json'
|
import pkg from '../package.json'
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
@@ -9,6 +10,9 @@ export default defineConfig({
|
|||||||
root: join(__dirname, '../src/renderer'),
|
root: join(__dirname, '../src/renderer'),
|
||||||
plugins: [
|
plugins: [
|
||||||
react(),
|
react(),
|
||||||
|
resolve({
|
||||||
|
electron: 'export default require("electron");',
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
base: './',
|
base: './',
|
||||||
build: {
|
build: {
|
||||||
@@ -25,4 +29,7 @@ export default defineConfig({
|
|||||||
host: pkg.env.HOST,
|
host: pkg.env.HOST,
|
||||||
port: pkg.env.PORT,
|
port: pkg.env.PORT,
|
||||||
},
|
},
|
||||||
|
optimizeDeps: {
|
||||||
|
exclude: ['electron'],
|
||||||
|
}
|
||||||
})
|
})
|
||||||
Reference in new issue
Block a user