chore: refine routing in vercel.json and set consistent base paths in vite.config.ts and router.tsx
This commit is contained in:
@@ -2,15 +2,11 @@
|
|||||||
"rewrites": [
|
"rewrites": [
|
||||||
{
|
{
|
||||||
"source": "/docs",
|
"source": "/docs",
|
||||||
"destination": "https://ciodocs.vercel.app"
|
"destination": "https://ciodocs.vercel.app/docs"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/docs/:path*",
|
"source": "/docs/:path*",
|
||||||
"destination": "https://ciodocs.vercel.app/:path*"
|
"destination": "https://ciodocs.vercel.app/docs/:path*"
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/assets/:path*",
|
|
||||||
"destination": "https://ciodocs.vercel.app/assets/:path*"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { routeTree } from './routeTree.gen';
|
|||||||
|
|
||||||
export function getRouter() {
|
export function getRouter() {
|
||||||
return createTanStackRouter({
|
return createTanStackRouter({
|
||||||
|
basepath: '/docs',
|
||||||
defaultNotFoundComponent: NotFound,
|
defaultNotFoundComponent: NotFound,
|
||||||
defaultPreload: 'intent',
|
defaultPreload: 'intent',
|
||||||
routeTree,
|
routeTree,
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export default defineConfig({
|
|||||||
server: {
|
server: {
|
||||||
port: 3000
|
port: 3000
|
||||||
},
|
},
|
||||||
|
base: '/docs',
|
||||||
plugins: [
|
plugins: [
|
||||||
mdx(await import('./source.config')),
|
mdx(await import('./source.config')),
|
||||||
tailwindcss(),
|
tailwindcss(),
|
||||||
@@ -21,6 +22,7 @@ export default defineConfig({
|
|||||||
// see https://tanstack.com/start/latest/docs/framework/react/guide/hosting for hosting config
|
// see https://tanstack.com/start/latest/docs/framework/react/guide/hosting for hosting config
|
||||||
// we configured nitro by default
|
// we configured nitro by default
|
||||||
nitro({
|
nitro({
|
||||||
|
baseURL: '/docs'
|
||||||
// routeRules: {
|
// routeRules: {
|
||||||
// '/': {
|
// '/': {
|
||||||
// proxy: 'https://classroomio-com.vercel.app/'
|
// proxy: 'https://classroomio-com.vercel.app/'
|
||||||
|
|||||||
Reference in New Issue
Block a user