You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
707 B

  1. import { fileURLToPath, URL } from 'node:url'
  2. import { defineConfig } from 'vite'
  3. import vue from '@vitejs/plugin-vue'
  4. // https://vite.dev/config/
  5. export default defineConfig({
  6. plugins: [
  7. vue(),
  8. // vueDevTools(),
  9. ],
  10. resolve: {
  11. alias: {
  12. '@': fileURLToPath(new URL('./src', import.meta.url))
  13. },
  14. },
  15. // base: '/investvote/', // 服务器:设置资源的基础路径
  16. server: {
  17. proxy: {
  18. '/api': {
  19. //后端服务器地址
  20. // target: 'http://mp.homilychart.com', //服务器地址
  21. target: 'http://192.168.8.174:8092', //本地调试地址
  22. changeOrigin: true,
  23. rewrite: (path) => path.replace(/^\/api/, '')
  24. }
  25. }
  26. }
  27. })