vite.config.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import path from 'path'
  4. // https://vitejs.dev/config/
  5. export default defineConfig({
  6. plugins: [vue()],
  7. resolve: {
  8. alias: {
  9. '@': path.resolve(__dirname, './src'),
  10. 'Timor': path.resolve(__dirname, '../Timor')
  11. },
  12. },
  13. css:{
  14. preprocessorOptions:{
  15. less:{
  16. javascriptEnabled: true
  17. }
  18. }
  19. },
  20. build:{
  21. assetsDir:"public"
  22. },
  23. define: {
  24. 'process.env': {}
  25. },
  26. // server: {
  27. // host: "0.0.0.0",
  28. // proxy: {
  29. // '/test': {
  30. // target: 'http://dmrv.360chief.com',// http://10.199.40.73:8080
  31. // changeOrigin: true,
  32. // rewrite: (path) => path.replace(/^\/test/, '')
  33. // },
  34. // }
  35. // },
  36. server: {
  37. host: "0.0.0.0",
  38. proxy: {
  39. '/test': {
  40. secure: false,
  41. target: 'https://dmrv-test.fuxicarbon.com', // http://10.199.40.73:8080
  42. changeOrigin: true,
  43. rewrite: (path) => path.replace(/^\/test/, '')
  44. },
  45. '/curriculum': {
  46. secure: false,
  47. target: 'https://insight.fuxicarbon.com', // http://10.199.40.73:8080
  48. changeOrigin: true,
  49. rewrite: (path) => path.replace(/^\/curriculum/, '')
  50. },
  51. }
  52. }
  53. })