tov-template
tov-template copied to clipboard
Vite 中的Base修改后会影响到路由
将Vite.config.ts中修改了Base 之后,编译后的路由会收到影响
设置base:'./'之后打包,生产环境浏览报错index-3XgwbOFl.js:42 Uncaught Error: Invalid path "./"
at tokenizePath (index-3XgwbOFl.js:42:10700)
at createRouteRecordMatcher (index-3XgwbOFl.js:42:11784)
at s (index-3XgwbOFl.js:42:12505)
at index-3XgwbOFl.js:42:13935
at Array.forEach (
把 import Tov from './presets'; 中的 import Router from 'unplugin-vue-router/vite'; 自动路由导入注释,然后去routes中手动配置路由再重新打包即可解决问题