vite.config.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { fileURLToPath, URL } from 'node:url';
  2. import { defineConfig } from 'vite';
  3. import vue from '@vitejs/plugin-vue';
  4. const path = require('path');
  5. const common = path.resolve(__dirname, '../common');
  6. export default defineConfig({
  7. plugins: [vue()],
  8. server: {
  9. port: 20001,
  10. proxy: {
  11. '/files': {
  12. target: 'http://basic.waityou24.cn',
  13. },
  14. '/jcyjdtglpt/v1/api': {
  15. target: 'http://192.168.1.113:13010',
  16. changeOrigin: true,
  17. ws: false,
  18. },
  19. '/semail/api': {
  20. target: 'http://192.168.1.113:16001',
  21. changeOrigin: true,
  22. ws: false,
  23. },
  24. '/studioadmin/api': {
  25. target: 'http://192.168.1.113:16001',
  26. changeOrigin: true,
  27. ws: false,
  28. },
  29. },
  30. },
  31. resolve: {
  32. alias: {
  33. '@': fileURLToPath(new URL('./src', import.meta.url)),
  34. '@common': common,
  35. },
  36. },
  37. css: {
  38. preprocessorOptions: {
  39. scss: {
  40. additionalData: `@import "@/assets/style/mixin.scss";`, // 此处全局的scss文件
  41. },
  42. },
  43. },
  44. });