修改vite.config.js
增加:
build: {
outDir:‘…/out’
},
base: ‘./’,
例子:
// https://vitejs.dev/config/
export default defineConfig({plugins: [vue(),WindiCSS()],build: {outDir:'../out'},base: './',server: {host:'0.0.0.0',// https:{// cert: fs.readFileSync(path.join(__dirname, 'cert.crt')),// key: fs.readFileSync(path.join(__dirname, 'cert.key')),// },
}})
官网说明:
https://vitejs.dev/config/