vite.config.js 678 B

12345678910111213141516171819202122232425262728293031
  1. import path from 'path'
  2. import { defineConfig } from 'vite'
  3. import { createVuePlugin } from 'vite-plugin-vue2'
  4. export default defineConfig({
  5. base: '/',
  6. resolve: {
  7. alias: {
  8. '@': path.resolve(__dirname, 'src'),
  9. 'vue': 'vue/dist/vue.common'
  10. }
  11. },
  12. server: {
  13. host: '0.0.0.0',
  14. port: 3001
  15. },
  16. plugins: [
  17. createVuePlugin({
  18. jsx: true,
  19. // 解决Dom结构中会出现多余的空白字符,导致文本内容间出现分隔、行内标签间出现空格
  20. vueTemplateOptions: {
  21. compilerOptions: {
  22. whitespace: 'condense'
  23. }
  24. },
  25. jsxOptions: {
  26. compositionAPI: true
  27. }
  28. }),
  29. ]
  30. })