2024-01-08 12:23:57 -05:00
|
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
|
|
|
|
import { defineConfig } from 'vite'
|
2024-01-11 13:46:08 -05:00
|
|
|
import {proxy} from "./proxy.js";
|
2024-01-08 12:23:57 -05:00
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
2024-08-10 00:25:25 -04:00
|
|
|
export default defineConfig(({mode}) => {
|
2024-08-10 19:03:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
if (mode === 'electron'){
|
2024-08-10 00:25:25 -04:00
|
|
|
return {
|
2024-08-10 19:03:21 -04:00
|
|
|
emptyOutDir: false,
|
|
|
|
base: './',
|
2024-08-10 00:25:25 -04:00
|
|
|
plugins: [
|
|
|
|
vue(),
|
|
|
|
],
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
|
|
}
|
|
|
|
},
|
|
|
|
build: {
|
2024-08-11 16:39:00 -04:00
|
|
|
outDir: '../../../../WGDashboard-Desktop',
|
2024-08-10 00:25:25 -04:00
|
|
|
rollupOptions: {
|
|
|
|
output: {
|
|
|
|
entryFileNames: `assets/[name].js`,
|
|
|
|
chunkFileNames: `assets/[name].js`,
|
|
|
|
assetFileNames: `assets/[name].[ext]`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-01-08 12:23:57 -05:00
|
|
|
}
|
2024-08-10 00:25:25 -04:00
|
|
|
}
|
|
|
|
|
2024-08-10 19:03:21 -04:00
|
|
|
return {
|
|
|
|
base: "/static/app/dist",
|
|
|
|
plugins: [
|
|
|
|
vue(),
|
|
|
|
],
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
|
|
}
|
|
|
|
},
|
|
|
|
server:{
|
|
|
|
proxy: {
|
|
|
|
'/api': proxy
|
2024-08-10 00:25:25 -04:00
|
|
|
},
|
2024-08-10 19:03:21 -04:00
|
|
|
host: '0.0.0.0'
|
|
|
|
},
|
|
|
|
build: {
|
|
|
|
outDir: 'dist',
|
|
|
|
rollupOptions: {
|
|
|
|
output: {
|
|
|
|
entryFileNames: `assets/[name].js`,
|
|
|
|
chunkFileNames: `assets/[name].js`,
|
|
|
|
assetFileNames: `assets/[name].[ext]`
|
2024-08-10 00:25:25 -04:00
|
|
|
}
|
2024-01-23 15:09:44 -05:00
|
|
|
}
|
|
|
|
}
|
2024-01-08 12:23:57 -05:00
|
|
|
}
|
|
|
|
})
|