vite.config.ts 655 B

123456789101112131415161718192021222324252627282930
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import legacy from '@vitejs/plugin-legacy';
  4. export default defineConfig({
  5. plugins: [vue(),
  6. legacy({
  7. targets: ['> 0.1%', 'not dead','chrome <= 66'],
  8. additionalLegacyPolyfills: [
  9. 'core-js/stable',
  10. 'regenerator-runtime/runtime',
  11. ],
  12. })
  13. ],
  14. server: {
  15. host: '0.0.0.0', // 允许通过局域网访问
  16. port: 5173, // 修改为你需要的端口号
  17. },
  18. resolve: {
  19. alias: {
  20. '@': '/src'
  21. }
  22. },
  23. optimizeDeps: {
  24. include: ['vue']
  25. },
  26. base:'./',
  27. build: {
  28. sourcemap: process.env.ENV === 'development',
  29. },
  30. })