vite.config.js 408 B

12345678910111213141516171819
  1. import { defineConfig, loadEnv } from "vite";
  2. import vue from "@vitejs/plugin-vue";
  3. export default defineConfig(({ mode }) => {
  4. const env = loadEnv(mode, process.cwd(), "");
  5. return {
  6. plugins: [vue()],
  7. server: {
  8. port: Number(env.VITE_PORT || 5173),
  9. proxy: {
  10. "/api": {
  11. target: env.VITE_PROXY_TARGET,
  12. changeOrigin: true,
  13. },
  14. },
  15. },
  16. };
  17. });