internal/dashboard/frontend/vite.config.ts

import tailwindcss from "@tailwindcss/vite";
import vue from "@vitejs/plugin-vue";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
import checker from "vite-plugin-checker";

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    tailwindcss(),
    checker({
      vueTsc: { tsconfigPath: "./tsconfig.app.json" },
    }),
  ],
  resolve: {
    alias: {
      components: fileURLToPath(new URL("./src/components", import.meta.url)),
      composables: fileURLToPath(new URL("./src/composables", import.meta.url)),
      utils: fileURLToPath(new URL("./src/utils", import.meta.url)),
      src: fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
  define: {
    __APP_VERSION__: JSON.stringify(process.env.npm_package_version),
  },
  server: {
    proxy: {
      "/api": {
        target: "http://localhost:8081",
      },
      "/ws": {
        target: "http://localhost:8081",
        ws: true,
      },
    },
  },
});