25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vite.config.js 1.6KB

1 개월 전
1 주 전
12 시간 전
1 개월 전
12 시간 전
1 개월 전
3 주 전
1 개월 전
5 일 전
1 개월 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import eslintPlugin from 'vite-plugin-eslint'
  4. import VueSetupExtend from 'vite-plugin-vue-setup-extend'
  5. import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
  6. import vueJsx from '@vitejs/plugin-vue-jsx'
  7. import path from 'path'
  8. // import vueDevTools from 'vite-plugin-vue-devtools'
  9. // https://vitejs.dev/config
  10. import vueDevTools from 'vite-plugin-vue-devtools'
  11. export default defineConfig(() => {
  12. return {
  13. plugins: [
  14. vueDevTools({
  15. launchEditor: 'webstorm'
  16. }),
  17. vue(),
  18. VueSetupExtend(),
  19. vueJsx({
  20. // options are passed on to @vue/babel-plugin-jsx
  21. }),
  22. eslintPlugin({
  23. include: ['src/**/*.js', 'src/**/*.vue', 'src/*.js', 'src/*.vue']
  24. }),
  25. createSvgIconsPlugin({
  26. // 配置路径在你的src里的svg存放文件
  27. iconDirs: [path.resolve(process.cwd(), './src/assets/icons/svgs')],
  28. // 指定symbolId格式
  29. symbolId: 'icon-[dir]-[name]'
  30. })
  31. ],
  32. resolve: {
  33. // 配置路径别名
  34. alias: {
  35. '@': path.resolve(__dirname, './src')
  36. }
  37. },
  38. build: {
  39. // target: ['es2015', 'chrome58']
  40. // rollupOptions: {
  41. // manualChunks: (id) => {
  42. // if (id.includes('node_modules')) {
  43. // return 'vendor'
  44. // }
  45. // }
  46. // }
  47. },
  48. server: {
  49. open: true,
  50. host: '0.0.0.0',
  51. proxy: {
  52. '/pm': {
  53. // 后台地址 http://121.199.28.40:9089
  54. target: 'http://hzxg.ningdatech.com/',
  55. changeOrigin: true
  56. }
  57. }
  58. }
  59. }
  60. })