zhongshujie
4 天以前 90675cb210f5a2afc4766e6fd091776a14397d48
vite.config.ts
@@ -1,14 +1,26 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import legacyPlugin from '@vitejs/plugin-legacy'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  plugins: [
    vue(),
    legacyPlugin({
      targets: ['defaults', 'chrome 52', 'ie >= 11','Safari >= 8'],  // 需要兼容的目标列表,可以设置多个
      additionalLegacyPolyfills: ['regenerator-runtime/runtime'], // 面向IE11时需要此插件
      renderLegacyChunks: true,
      polyfills: true,
      modernPolyfills: true,
    })
  ],
  build:{target: ['ios8', 'edge90', 'chrome52', 'firefox90', 'safari8']},
  server: {
    host: true, // Expose to all network interfaces
    port: 5174, // Default Vite port
    host: '0.0.0.0' // Expose to all network interfaces
    // port: 5174, // Default Vite port
  },
  base: "./",
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')