vite.config.ts 865 B

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