fix(nitro): generate netlify _redirects in public (#298)

This commit is contained in:
Daniel Roe 2021-07-01 13:49:42 +01:00 committed by GitHub
parent b1948b1921
commit 1126255835
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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')