vite.config.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import { resolve } from 'path'
  4. export default defineConfig({
  5. base: process.env.NODE_ENV === 'production' ? './' : '/',
  6. plugins: [vue()],
  7. resolve: {
  8. alias: {
  9. '@': resolve(__dirname, 'src')
  10. }
  11. },
  12. // define: {
  13. // 'process.env': {
  14. // 'BASE_API':"https://cucu.cnyunl.com:8079/"
  15. // }
  16. // },
  17. // server: {
  18. // proxy: {
  19. // "/api": {
  20. // target: "https://cucu.cnyunl.com:8079/",
  21. // ws: true,
  22. // changeOrigin: true,
  23. // rewrite: (path) => path.replace(/^\/api/, ""),
  24. // },
  25. // },
  26. // },
  27. define: {
  28. 'process.env': {
  29. 'BASE_API':"http://61.164.207.46:8200/"
  30. }
  31. },
  32. server: {
  33. proxy: {
  34. "/api": {
  35. target: "http://61.164.207.46:8200/",
  36. ws: true,
  37. changeOrigin: true,
  38. rewrite: (path) => path.replace(/^\/api/, ""),
  39. },
  40. },
  41. },
  42. build: {
  43. rollupOptions: {
  44. output: {
  45. manualChunks: {
  46. vue: ['vue'],
  47. 'vue-router': ['vue-router']
  48. }
  49. }
  50. }
  51. },
  52. css:{
  53. preprocessorOptions:{
  54. less:{
  55. modifyVars: {},
  56. javascriptEnabled: true
  57. }
  58. }
  59. }
  60. })