Files
WGDashboard/src/static/app/vite.config.js

65 lines
1.2 KiB
JavaScript
Raw Normal View History

2024-01-08 12:23:57 -05:00
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import {proxy} from "./proxy.js";
2024-01-08 12:23:57 -05:00
import vue from '@vitejs/plugin-vue'
2024-11-07 10:37:11 +08:00
import {v1} from "uuid";
2024-11-07 00:03:40 +08:00
2024-08-10 00:25:25 -04:00
export default defineConfig(({mode}) => {
2024-11-07 00:09:40 +08:00
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: {
2024-11-07 10:37:11 +08:00
entryFileNames: `assets/[name]-[hash].js`,
chunkFileNames: `assets/[name]-[hash].js`,
assetFileNames: `assets/[name]-[hash].[ext]`
2024-11-07 00:09:40 +08:00
}
}
}
}
}
2024-08-10 00:25:25 -04:00
2024-11-07 00:09:40 +08:00
return {
base: "/static/app/dist",
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server:{
proxy: {
2024-12-26 00:06:37 +08:00
'/api': proxy,
'/fileDownload':proxy
2024-11-07 00:09:40 +08:00
},
host: '0.0.0.0'
},
build: {
target: "es2022",
outDir: 'dist',
rollupOptions: {
output: {
2024-11-07 10:37:11 +08:00
entryFileNames: `assets/[name]-[hash].js`,
chunkFileNames: `assets/[name]-[hash].js`,
assetFileNames: `assets/[name]-[hash].[ext]`
2024-11-07 00:09:40 +08:00
}
}
}
}
2024-01-08 12:23:57 -05:00
})