23 lines
501 B
TypeScript
23 lines
501 B
TypeScript
|
import { defineConfig } from 'vite'
|
||
|
import react from '@vitejs/plugin-react'
|
||
|
import { builtinModules } from 'module'
|
||
|
import path from 'path'
|
||
|
|
||
|
export default defineConfig({
|
||
|
plugins: [react()],
|
||
|
build: {
|
||
|
outDir: 'dist',
|
||
|
rollupOptions: {
|
||
|
external: [
|
||
|
...builtinModules,
|
||
|
'electron' // 排除 Electron 原生模块
|
||
|
]
|
||
|
}
|
||
|
},
|
||
|
resolve: {
|
||
|
alias: {
|
||
|
'@': path.resolve(__dirname, './src'),
|
||
|
'~electron': path.resolve(__dirname, './electron')
|
||
|
}
|
||
|
}
|
||
|
})
|