From 1126255835750c8533c0294ba4ce52d7d71ee615 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 1 Jul 2021 13:49:42 +0100 Subject: [PATCH] fix(nitro): generate netlify `_redirects` in public (#298) --- packages/nitro/src/presets/netlify.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nitro/src/presets/netlify.ts b/packages/nitro/src/presets/netlify.ts index 21f55b8b37..201e9f58f0 100644 --- a/packages/nitro/src/presets/netlify.ts +++ b/packages/nitro/src/presets/netlify.ts @@ -12,7 +12,7 @@ export const netlify: NitroPreset = extendPreset(lambda, { }, hooks: { async 'nitro:compiled' (ctx: NitroContext) { - const redirectsPath = join(ctx._nuxt.rootDir, '_redirects') + const redirectsPath = join(ctx.output.publicDir, '_redirects') let contents = '/* /.netlify/functions/server 200' if (existsSync(redirectsPath)) { const currentRedirects = await readFile(redirectsPath, 'utf-8')