File tree Expand file tree Collapse file tree 3 files changed +14
-24
lines changed
Expand file tree Collapse file tree 3 files changed +14
-24
lines changed Original file line number Diff line number Diff line change 77 * - /package/vue/ → /package/vue
88 * - /docs/getting-started/?query=value → /docs/getting-started?query=value
99 */
10- export default defineNuxtRouteMiddleware ( ( ) => {
11- // if (import.meta.server) {
12- // const event = useRequestEvent()
13- // const url = event?.node.req.originalUrl || event?.node.req.url || ''
10+ export default defineNuxtRouteMiddleware ( to => {
11+ if ( ! import . meta. dev ) return
1412
15- // if (url.includes('_payload')) return
16- // }
17-
18- // if (to.path !== '' && !to.path.endsWith('/')) {
19- // return navigateTo(
20- // {
21- // path: to.path + '/',
22- // query: to.query,
23- // hash: to.hash,
24- // },
25- // { replace: true },
26- // )
27- // }
28- return
13+ if ( to . path !== '/' && to . path . endsWith ( '/' ) ) {
14+ return navigateTo (
15+ {
16+ path : to . path . slice ( 0 , - 1 ) ,
17+ query : to . query ,
18+ hash : to . hash ,
19+ } ,
20+ { replace : true } ,
21+ )
22+ }
2923} )
Original file line number Diff line number Diff line change @@ -132,11 +132,6 @@ export default defineNuxtConfig({
132132 allowQuery : [ 'q' ] ,
133133 } ,
134134 } ,
135- // pages
136- '/package/:name' : getISRConfig ( 60 ) ,
137- '/package/:name/v/:version' : getISRConfig ( 60 ) ,
138- '/package/:org/:name' : getISRConfig ( 60 ) ,
139- '/package/:org/:name/v/:version' : getISRConfig ( 60 ) ,
140135 // infinite cache (versioned - doesn't change)
141136 '/package-code/**' : { isr : true , cache : { maxAge : 365 * 24 * 60 * 60 } } ,
142137 '/package-docs/**' : { isr : true , cache : { maxAge : 365 * 24 * 60 * 60 } } ,
Original file line number Diff line number Diff line change 11{
22 "$schema" : " https://openapi.vercel.sh/vercel.json" ,
3+ "trailingSlash" : false ,
34 "redirects" : [
45 {
56 "source" : " /(.*)" ,
910 "value" : " chat.npmx.dev"
1011 }
1112 ],
12- "destination" : " https://npmx.dev/recharging "
13+ "destination" : " https://discord.gg/x9KE5U2q8w "
1314 },
1415 {
1516 "source" : " /(.*)" ,
You can’t perform that action at this time.
0 commit comments