advent22/ui/vite.config.ts
Jörn-Michael Miehe 005bb31fca into shared compose project
- vite can proxy requests to the api in dev mode
- no more CORS needed in api
- static api_baseurl in axios config
2026-02-22 02:47:31 +00:00

45 lines
852 B
TypeScript

import { fileURLToPath, URL } from "node:url";
import vue from "@vitejs/plugin-vue";
import { defineConfig } from "vite";
import { analyzer } from "vite-bundle-analyzer";
import { createHtmlPlugin } from "vite-plugin-html";
import vueDevTools from "vite-plugin-vue-devtools";
// https://vite.dev/config/
export default defineConfig({
plugins: [
vue(),
vueDevTools(),
analyzer({
analyzerMode: "static",
}),
createHtmlPlugin({
inject: {
data: {
title: "Kalender-Gewinnspiel",
},
},
}),
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
build: {
sourcemap: true,
},
server: {
proxy: {
'/api': {
target: 'http://api:8000',
changeOrigin: true,
secure: false,
},
},
},
});