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

64 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 00:09:40 +08:00
import { version } from './package.json'
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: {
entryFileNames: `assets/[name].js?v=${version}`,
chunkFileNames: `assets/[name].js?v=${version}`,
assetFileNames: `assets/[name].[ext]?v=${version}`
}
}
}
}
}
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: {
'/api': proxy
},
host: '0.0.0.0'
},
build: {
target: "es2022",
outDir: 'dist',
rollupOptions: {
output: {
entryFileNames: `assets/[name].js?v=${version}`,
chunkFileNames: `assets/[name].js?v=${version}`,
assetFileNames: `assets/[name].[ext]?v=${version}`
}
}
}
}
2024-01-08 12:23:57 -05:00
})