vite.config.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import {defineConfig} from 'vite'
  2. import legacy from '@vitejs/plugin-legacy'
  3. import vue from '@vitejs/plugin-vue'
  4. import {resolve} from 'path'
  5. // vue setup 的糖语法
  6. import VueSetupExtend from 'vite-plugin-vue-setup-extend'
  7. // 不用导入 vue 的 import 了
  8. import AutoImport from 'unplugin-auto-import/vite'
  9. import Icons from "unplugin-icons/vite";
  10. const pathResolve = (dir) => {
  11. return resolve(__dirname, '.', dir)
  12. }
  13. const alias = {
  14. '@': pathResolve('src'),
  15. }
  16. export default defineConfig({
  17. resolve: {
  18. alias,
  19. },
  20. plugins: [
  21. Icons({
  22. autoInstall: true,
  23. compiler: "vue3",
  24. }),
  25. VueSetupExtend(),
  26. vue({
  27. refTransform: true
  28. }),
  29. legacy({
  30. targets: 'chrome 49',
  31. }),
  32. AutoImport({
  33. dts: 'src/auto-imports.d.ts',
  34. imports: ['vue']
  35. })
  36. ],
  37. server: {
  38. proxy: {
  39. '/emr/runtime': {
  40. target: 'http://172.16.32.122:8001', //这里配置运行时服务地址
  41. secure: false, //如果运行时服务是https,此处配置为true
  42. changeOrigin: true //支持跨域调用,这里配置为true
  43. },
  44. '/bdp/dataservice/api': {
  45. target: 'http://172.16.32.183:8888', //这里配置运行时服务地址
  46. secure: false, //如果运行时服务是https,此处配置为true
  47. changeOrigin: true //支持跨域调用,这里配置为true
  48. },
  49. }
  50. },
  51. build: {
  52. chunkSizeWarningLimit: 1000,
  53. },
  54. })