vite.config.ts 808 B

12345678910111213141516171819202122232425262728293031323334
  1. import { defineConfig } from "vite";
  2. import vue from "@vitejs/plugin-vue";
  3. import path from "path";
  4. import fs from "fs";
  5. // https://vitejs.dev/config/
  6. export default defineConfig({
  7. plugins: [vue()],
  8. resolve: {
  9. alias: {
  10. "@": path.resolve(__dirname, "src"),
  11. },
  12. },
  13. server: {
  14. host: "jpcj-h5.zzxcx.net",
  15. port: 443,
  16. https: {
  17. key: fs.readFileSync("./cert/6353984_jpcj-h5.zzxcx.net.key"),
  18. cert: fs.readFileSync("./cert/6353984_jpcj-h5.zzxcx.net.pem"),
  19. },
  20. proxy: {
  21. "/dev-api": {
  22. target: "https://jpcj-admin1.zzxcx.net/twzd-admin",
  23. changeOrigin: true,
  24. rewrite: (path) => path.replace(/^\/dev-api/, ""),
  25. },
  26. "/prod-api": {
  27. target: "http://1.15.29.64:8080/twzd-admin",
  28. changeOrigin: true,
  29. rewrite: (path) => path.replace(/^\/prod-api/, ""),
  30. },
  31. },
  32. },
  33. });