From 674691eed1949f281b26b1417517f68f11e7bcc7 Mon Sep 17 00:00:00 2001 From: Sabrina Date: Wed, 21 Aug 2024 15:24:51 -0400 Subject: [PATCH] fix: resolve trailing slash (#199) # Description Explicitly define trailing slash settings for URLs. There seems to be a redirect happening somehow that will redirect a URL for example: "docs.zksync.io/build" -> "docs.zksync.io/build/" but then the trailing slash is removed without a redirect. There may be a clash between hosting configuration, nuxt configuration, and nuxt seo module configuration. We want trailing slashes removed to be the default configuration for URLs and we do not want any redirects flipping between the two. --- firebase.json | 1 + nuxt.config.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/firebase.json b/firebase.json index 38e60deb..84856edf 100644 --- a/firebase.json +++ b/firebase.json @@ -1,5 +1,6 @@ { "hosting": { + "trailingSlash": false, "public": ".output/public", "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], "headers": [ diff --git a/nuxt.config.ts b/nuxt.config.ts index 469a38dc..09bd4d3d 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -24,6 +24,13 @@ export default defineNuxtConfig({ '/zk-stack/concepts': { redirect: '/zk-stack/concepts/transaction-lifecycle' }, '/zk-stack/running-a-zk-chain': { redirect: '/zk-stack/running-a-zk-chain/locally' }, }, + experimental: { + defaults: { + nuxtLink: { + trailingSlash: 'remove', + }, + }, + }, pwa: { selfDestroying: true, strategies: 'generateSW',