vite.config.ts 535 B

1234567891011121314151617181920212223
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import { resolve } from 'path'
  4. export default defineConfig({
  5. plugins: [vue()],
  6. //解决“vite use `--host` to expose”
  7. base: './',
  8. server: {
  9. host: '0.0.0.0',
  10. // port: 8080,
  11. open: true
  12. },
  13. resolve:{
  14. //别名配置,引用src路径下的东西可以通过@如:import Layout from '@/layout/index.vue'
  15. alias:[
  16. {
  17. find:'@',
  18. replacement:resolve(__dirname,'src')
  19. }
  20. ]
  21. }
  22. })