vite.config.ts 910 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import path from 'path'
  4. import AutoImport from 'unplugin-auto-import/vite'
  5. import Components from 'unplugin-vue-components/vite'
  6. import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
  7. export default defineConfig({
  8. plugins: [
  9. vue(),
  10. // AutoImport({
  11. // resolvers: [ElementPlusResolver()]
  12. // }),
  13. // Components({
  14. // resolvers: [ElementPlusResolver()]
  15. // })
  16. ],
  17. resolve: {
  18. alias: {
  19. '@': path.resolve(__dirname, 'src')
  20. }
  21. },
  22. css: {
  23. preprocessorOptions: {
  24. scss: {
  25. // additionalData: '@import "@/assets/styles/variable.scss";'
  26. }
  27. }
  28. },
  29. server:{
  30. host:"localhost",
  31. port:3000,
  32. proxy:{
  33. "/prod-api":{
  34. target:"http://172.16.120.165:13200/prod-api/",
  35. rewrite:path=>path.replace(/^\/prod-api/,"")
  36. }
  37. }
  38. }
  39. })