vite.config.ts 426 B

123456789101112131415161718192021
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import { resolve } from 'path'
  4. // https://vitejs.dev/config/
  5. export default defineConfig({
  6. plugins: [vue()],
  7. server: {
  8. host: '0.0.0.0', //解决“vite use `--host` to expose”
  9. port: 8080,
  10. open: true,
  11. hmr:true
  12. },
  13. resolve:{
  14. alias:[
  15. {
  16. find:'@',
  17. replacement:resolve(__dirname,'src')
  18. }
  19. ]
  20. }
  21. })