mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(nitro): generate netlify _redirects
in public (#298)
This commit is contained in:
parent
b1948b1921
commit
1126255835
@ -12,7 +12,7 @@ export const netlify: NitroPreset = extendPreset(lambda, {
|
|||||||
},
|
},
|
||||||
hooks: {
|
hooks: {
|
||||||
async 'nitro:compiled' (ctx: NitroContext) {
|
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'
|
let contents = '/* /.netlify/functions/server 200'
|
||||||
if (existsSync(redirectsPath)) {
|
if (existsSync(redirectsPath)) {
|
||||||
const currentRedirects = await readFile(redirectsPath, 'utf-8')
|
const currentRedirects = await readFile(redirectsPath, 'utf-8')
|
||||||
|
Loading…
Reference in New Issue
Block a user