vite.config.ts 804 B

12345678910111213141516171819202122232425262728293031323334
  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://basic.waityou24.cn',
  16. changeOrigin: true,
  17. ws: false,
  18. },
  19. },
  20. },
  21. resolve: {
  22. alias: {
  23. '@': fileURLToPath(new URL('./src', import.meta.url)),
  24. '@common': common,
  25. },
  26. },
  27. css: {
  28. preprocessorOptions: {
  29. scss: {
  30. additionalData: `@import "@/assets/style/mixin.scss";`, // 此处全局的scss文件
  31. },
  32. },
  33. },
  34. });