vite.config.js 498 B

12345678910111213141516171819202122232425
  1. import { fileURLToPath, URL } from 'node:url'
  2. import { defineConfig } from 'vite'
  3. import vue from '@vitejs/plugin-vue'
  4. // https://vitejs.dev/config/
  5. export default defineConfig({
  6. plugins: [
  7. vue(),
  8. ],
  9. server: {
  10. proxy: {
  11. '/api': {
  12. target: 'http://api.cocorobo.cn/',
  13. changeOrigin: true,
  14. // rewrite: (path) => path.replace(/^\/api/, '')
  15. },
  16. }
  17. },
  18. resolve: {
  19. alias: {
  20. '@': fileURLToPath(new URL('./src', import.meta.url))
  21. }
  22. }
  23. })