29 lines
710 B
TypeScript
29 lines
710 B
TypeScript
import { resolve } from 'path'
|
|
import { readFileSync } from 'fs'
|
|
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
const { version } = JSON.parse(readFileSync('./package.json', 'utf-8'))
|
|
|
|
export default defineConfig({
|
|
main: {
|
|
plugins: [externalizeDepsPlugin()]
|
|
},
|
|
preload: {
|
|
plugins: [externalizeDepsPlugin()]
|
|
},
|
|
renderer: {
|
|
publicDir: resolve('resources'),
|
|
define: {
|
|
'import.meta.env.VITE_APP_VERSION': JSON.stringify(version)
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@renderer': resolve('src/renderer/src')
|
|
}
|
|
},
|
|
plugins: [react(), tailwindcss()]
|
|
}
|
|
})
|