Tatsächlich ist dies sehr einfach: Ändern Sie
in vite.config.js
: einfach
das base
entsprechende Attribut von'./'
'/'
import {
defineConfig, loadEnv, ConfigEnv } from 'vite';
const viteConfig = defineConfig((mode: ConfigEnv) => {
const env = loadEnv(mode.mode, process.cwd());
return {
plugins: [vue()],
root: process.cwd(),
resolve: {
alias },
base: '/',
};
});