vite.config.ts 701 B

1234567891011121314151617181920212223242526272829
  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. "/prod-api": {
  22. target: "http://192.168.8.213:8080/twzd-admin",
  23. changeOrigin: true,
  24. rewrite: (path) => path.replace(/^\/prod-api/, ""),
  25. },
  26. },
  27. },
  28. });