vite.config.ts 905 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. const pathResolve = (pathStr: string) => {
  7. return path.resolve(__dirname, pathStr);
  8. };
  9. module.exports = defineConfig({
  10. plugins: [vue(), vueJsx()],
  11. alias: {
  12. '@': pathResolve('./src'),
  13. },
  14. server: {
  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://sdjk-admin1.zzxcx.net/sdjk-admin/",
  23. // changeOrigin: true,
  24. // rewrite: (path) => path.replace(/^\/dev-api/, ""),
  25. // },
  26. // "/prod-api": {
  27. // target: "https://sdjk-admin.zzxcx.net/sdjk-admin/",
  28. // changeOrigin: true,
  29. // rewrite: (path) => path.replace(/^\/prod-api/, ""),
  30. // },
  31. // },
  32. },
  33. });