vite.config.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import path from 'path'
  4. export default defineConfig({
  5. base: './',
  6. publicDir: 'static',
  7. plugins: [
  8. vue({
  9. template: {
  10. compilerOptions: {
  11. compatConfig: {
  12. MODE: 2
  13. }
  14. }
  15. }
  16. })
  17. ],
  18. resolve: {
  19. extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
  20. alias: {
  21. vue: '@vue/compat',
  22. '@': path.resolve(__dirname, 'src'),
  23. imgs: path.resolve(__dirname, 'src/assets/imgs')
  24. }
  25. },
  26. define: {
  27. 'process.env': {}
  28. },
  29. css: {
  30. preprocessorOptions: {
  31. scss: {
  32. additionalData: '@import "@/styles/variables.scss"; @import "@/styles/mixin.scss";'
  33. }
  34. }
  35. },
  36. server: {
  37. host: true,
  38. port: 8080,
  39. proxy: {
  40. '/tenant': {
  41. target: 'http://114.104.160.233:28002',
  42. changeOrigin: true
  43. },
  44. '/platform': {
  45. target: 'http://114.104.160.233:28002',
  46. changeOrigin: true
  47. }
  48. }
  49. }
  50. })