Closed genffy closed 3 years ago
Can not reproduce. Can you provide a repro link that can reproduce this issue?
import path from 'path';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
base: process.env.NODE_ENV === 'production' ? '/repo-name/' : './',
build: {
outDir: 'docs'
},
resolve: {
alias: {
'@': path.resolve(__dirname, '/src')
}
},
plugins: [vue()]
});
I'm using vue-ruter-next
success :
https://user-name.github.io/repo-name/
, https://user-name.github.io/repo-name/about
wrong:
https://user-name.github.io/
https://user-name.github.io/about
Are you passing the correct base
option in your call to createWebHistory
?
https://next.router.vuejs.org/api/#createwebhistory
(should be import.meta.env.BASE_URL
)
Can not reproduce. Can you provide a repro link that can reproduce this issue?
Add some details for issue.
⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.
Describe the bug
create demo
change file content
change file
vite.config.ts
content to :change file
index.html
content to :result
Just
npm run dev
and then open linkhttp://localhost:3000/path-name/
will see404
error in browser.But
run run build
work correctReproduction
see above
System Info
vite
version:2.0.1