diff --git a/packages/astro/src/core/build/generate.ts b/packages/astro/src/core/build/generate.ts index e43f1ff5f55f..9f3a9076919c 100644 --- a/packages/astro/src/core/build/generate.ts +++ b/packages/astro/src/core/build/generate.ts @@ -456,8 +456,8 @@ function getUrlForPath( pathname: string, base: string, origin: string, - format: AstroConfig["build"]["format"], - trailingSlash: AstroConfig["trailingSlash"], + format: AstroConfig['build']['format'], + trailingSlash: AstroConfig['trailingSlash'], routeType: RouteType ): URL { /** @@ -465,7 +465,7 @@ function getUrlForPath( * pathname: /, /foo * base: / */ - const ending = format === 'directory' ? trailingSlash === 'never' ? '' : '/' : '.html'; + const ending = format === 'directory' ? (trailingSlash === 'never' ? '' : '/') : '.html'; let buildPathname: string; if (pathname === '/' || pathname === '') { buildPathname = base;