mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-09-01 09:31:14 +00:00
65 lines
1.2 KiB
JavaScript
65 lines
1.2 KiB
JavaScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import { defineConfig } from 'vite'
|
|
import {proxy} from "./proxy.js";
|
|
import vue from '@vitejs/plugin-vue'
|
|
import {v1} from "uuid";
|
|
|
|
export default defineConfig(({mode}) => {
|
|
if (mode === 'electron'){
|
|
return {
|
|
emptyOutDir: false,
|
|
base: './',
|
|
plugins: [
|
|
vue(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
build: {
|
|
target: "es2022",
|
|
outDir: '../../../../WGDashboard-Desktop',
|
|
rollupOptions: {
|
|
output: {
|
|
entryFileNames: `assets/[name]-[hash].js`,
|
|
chunkFileNames: `assets/[name]-[hash].js`,
|
|
assetFileNames: `assets/[name]-[hash].[ext]`
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return {
|
|
base: "/static/app/dist",
|
|
plugins: [
|
|
vue(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
server:{
|
|
proxy: {
|
|
'/api': proxy,
|
|
'/fileDownload':proxy
|
|
},
|
|
host: '0.0.0.0'
|
|
},
|
|
build: {
|
|
target: "es2022",
|
|
outDir: 'dist',
|
|
rollupOptions: {
|
|
output: {
|
|
entryFileNames: `assets/[name]-[hash].js`,
|
|
chunkFileNames: `assets/[name]-[hash].js`,
|
|
assetFileNames: `assets/[name]-[hash].[ext]`
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|