公司官网
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.

29 lines
871 B

2 months ago
2 months ago
2 months ago
  1. import vue from '@vitejs/plugin-vue'
  2. import { defineConfig, loadEnv } from 'vite';
  3. import path from 'path';
  4. // https://vite.dev/config/
  5. export default defineConfig(({ command, mode }) => {
  6. const env = loadEnv(mode, process.cwd());
  7. return {
  8. plugins: [vue()],
  9. resolve: {
  10. alias: {
  11. '@': path.resolve(__dirname, 'src')
  12. }
  13. },
  14. server: {
  15. host: '0.0.0.0',
  16. port: env.VITE_APP_PORT ? Number(env.VITE_APP_PORT) : 3000,
  17. open: true,
  18. proxy: {
  19. [env.VITE_APP_BASE_API]: {
  20. target: 'http://localhost:8080',
  21. changeOrigin: true,
  22. ws: true,
  23. rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
  24. }
  25. }
  26. },
  27. }
  28. })