Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite 中的Base修改后会影响到路由 #199

Open
woddle opened this issue Aug 9, 2024 · 2 comments
Open

Vite 中的Base修改后会影响到路由 #199

woddle opened this issue Aug 9, 2024 · 2 comments

Comments

@woddle
Copy link

woddle commented Aug 9, 2024

将Vite.config.ts中修改了Base 之后,编译后的路由会收到影响

@ShouJen
Copy link

ShouJen commented Aug 27, 2024

设置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 ()
at createRouterMatcher (index-3XgwbOFl.js:42:13924)
at createRouter (index-3XgwbOFl.js:42:21047)
at index-3XgwbOFl.js:42:28780

@ShouJen
Copy link

ShouJen commented Aug 27, 2024

把 import Tov from './presets'; 中的 import Router from 'unplugin-vue-router/vite'; 自动路由导入注释,然后去routes中手动配置路由再重新打包即可解决问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants