mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nitro): generate correct netlify entrypoint (#372)
This commit is contained in:
parent
a57b9e1887
commit
e43e9cf71a
1
.gitignore
vendored
1
.gitignore
vendored
@ -62,3 +62,4 @@ Temporary Items
|
||||
.vercel_build_output
|
||||
.build-*
|
||||
.env
|
||||
.netlify
|
||||
|
@ -9,6 +9,7 @@ import type { NodeExternalsOptions } from './rollup/plugins/externals'
|
||||
import type { StorageOptions } from './rollup/plugins/storage'
|
||||
import type { AssetOptions } from './rollup/plugins/assets'
|
||||
import type { ServerMiddleware } from './server/middleware'
|
||||
import type { RollupConfig } from './rollup/config'
|
||||
|
||||
export interface NitroContext {
|
||||
timing: boolean
|
||||
@ -20,7 +21,7 @@ export interface NitroContext {
|
||||
entry: string
|
||||
node: boolean
|
||||
preset: string
|
||||
rollupConfig?: any
|
||||
rollupConfig?: RollupConfig
|
||||
renderer: string
|
||||
serveStatic: boolean
|
||||
middleware: ServerMiddleware[]
|
||||
|
@ -7,7 +7,7 @@ import { lambda } from './lambda'
|
||||
|
||||
export const netlify: NitroPreset = extendPreset(lambda, {
|
||||
output: {
|
||||
dir: '{{ _nuxt.rootDir }}/netlify/functions',
|
||||
dir: '{{ _nuxt.rootDir }}/.netlify/functions-internal',
|
||||
publicDir: '{{ _nuxt.rootDir }}/dist'
|
||||
},
|
||||
hooks: {
|
||||
@ -24,6 +24,9 @@ export const netlify: NitroPreset = extendPreset(lambda, {
|
||||
contents = currentRedirects + '\n' + contents
|
||||
}
|
||||
await writeFile(redirectsPath, contents)
|
||||
},
|
||||
'nitro:rollup:before' (ctx: NitroContext) {
|
||||
ctx.rollupConfig.output.entryFileNames = 'server.ts'
|
||||
}
|
||||
},
|
||||
ignore: [
|
||||
|
@ -1,6 +1,5 @@
|
||||
// @ts-ignore
|
||||
import { builderFunction } from '@netlify/functions'
|
||||
import { builder } from '@netlify/functions'
|
||||
// @ts-ignore
|
||||
import { handler as _handler } from '#nitro/entries/lambda'
|
||||
|
||||
export const handler = builderFunction(_handler)
|
||||
export const handler = builder(_handler)
|
||||
|
Loading…
Reference in New Issue
Block a user