vite配置导出静态html
import { fileURLToPath, URL } from 'node:url' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import legacy from '@vitejs/plugin-legacy' //这个插件方可实现导出静态html // https://vitejs.dev/config/ export default defineConfig({ plugins: [ vue(), vueJsx(), legacy({ targets: ['defaults', 'not IE 11'], }), ], base: "./", resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } }, server: { port: 7383, host: "0.0.0.0" } })
注意:路由改成hash