diff --git a/packages/astro/src/assets/build/generate.ts b/packages/astro/src/assets/build/generate.ts index 613b80ee0..283e957a3 100644 --- a/packages/astro/src/assets/build/generate.ts +++ b/packages/astro/src/assets/build/generate.ts @@ -1,13 +1,13 @@ import fs, { readFileSync } from 'node:fs'; import { basename, join } from 'node:path/posix'; import type { BuildPipeline } from '../../core/build/buildPipeline.js'; +import { getOutDirWithinCwd } from '../../core/build/common.js'; import { prependForwardSlash } from '../../core/path.js'; import { isServerLikeOutput } from '../../prerender/utils.js'; import { getConfiguredImageService, isESMImportedImage } from '../internal.js'; import type { LocalImageService } from '../services/service.js'; import type { ImageMetadata, ImageTransform } from '../types.js'; import { loadRemoteImage, type RemoteCacheEntry } from './remote.js'; -import { getOutDirWithinCwd } from "../../core/build/common.js"; interface GenerationDataUncached { cached: false; diff --git a/packages/astro/src/core/render/params-and-props.ts b/packages/astro/src/core/render/params-and-props.ts index 8c75e75e2..ac2884a7a 100644 --- a/packages/astro/src/core/render/params-and-props.ts +++ b/packages/astro/src/core/render/params-and-props.ts @@ -27,7 +27,7 @@ export async function getParamsAndProps(opts: GetParamsAndPropsOptions): Promise const params = getRouteParams(route, pathname) ?? {}; if (routeIsRedirect(route)) { - return [params, {}] + return [params, {}]; } validatePrerenderEndpointCollision(route, mod, params); diff --git a/packages/astro/test/redirects.test.js b/packages/astro/test/redirects.test.js index a5a065309..bf9ad15f5 100644 --- a/packages/astro/test/redirects.test.js +++ b/packages/astro/test/redirects.test.js @@ -199,7 +199,7 @@ describe('Astro.redirect', () => { const response = await fixture.fetch('/more/old/hello/world', { redirect: 'manual' }); expect(response.headers.get('Location')).to.equal('/more/hello/world'); }); - + it.skip('falls back to spread rule when dynamic rules should not match', async () => { const response = await fixture.fetch('/more/old/welcome/world', { redirect: 'manual' }); expect(response.headers.get('Location')).to.equal('/more/new/welcome/world');