vite.config.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import {resolve} from "path";
  4. // https://vitejs.dev/config/
  5. export default defineConfig({
  6. plugins: [vue()],
  7. base: '/',
  8. resolve: {
  9. alias: {
  10. '@': resolve(__dirname, 'src'),
  11. },
  12. },
  13. server: {
  14. port: 6886,
  15. // open: true,
  16. https: false,
  17. base: './',
  18. host: '0.0.0.0',
  19. strictPort: false,
  20. proxy: {
  21. '/api/': {
  22. // target: 'http://localhost:8080/',
  23. target: 'http://127.0.0.1:3333/',
  24. // target: 'http://192.168.1.110:8080/',
  25. changeOrigin: true,
  26. rewrite: path => {
  27. return path.replace(/^\/api/, '')
  28. }
  29. },
  30. '/api-gateway/': {
  31. // target: 'http://localhost:8080/',
  32. target: 'http://127.0.0.1:4444/',
  33. // target: 'http://192.168.1.110:8080/',
  34. changeOrigin: true,
  35. rewrite: path => {
  36. return path.replace(/^\/api-gateway/, '')
  37. }
  38. },
  39. }
  40. },
  41. build: {
  42. outDir: "social-management-screen",
  43. },
  44. publicDir: 'src/out',
  45. optimizeDeps: {
  46. include: []
  47. }
  48. })