mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +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
|
.vercel_build_output
|
||||||
.build-*
|
.build-*
|
||||||
.env
|
.env
|
||||||
|
.netlify
|
||||||
|
@ -9,6 +9,7 @@ import type { NodeExternalsOptions } from './rollup/plugins/externals'
|
|||||||
import type { StorageOptions } from './rollup/plugins/storage'
|
import type { StorageOptions } from './rollup/plugins/storage'
|
||||||
import type { AssetOptions } from './rollup/plugins/assets'
|
import type { AssetOptions } from './rollup/plugins/assets'
|
||||||
import type { ServerMiddleware } from './server/middleware'
|
import type { ServerMiddleware } from './server/middleware'
|
||||||
|
import type { RollupConfig } from './rollup/config'
|
||||||
|
|
||||||
export interface NitroContext {
|
export interface NitroContext {
|
||||||
timing: boolean
|
timing: boolean
|
||||||
@ -20,7 +21,7 @@ export interface NitroContext {
|
|||||||
entry: string
|
entry: string
|
||||||
node: boolean
|
node: boolean
|
||||||
preset: string
|
preset: string
|
||||||
rollupConfig?: any
|
rollupConfig?: RollupConfig
|
||||||
renderer: string
|
renderer: string
|
||||||
serveStatic: boolean
|
serveStatic: boolean
|
||||||
middleware: ServerMiddleware[]
|
middleware: ServerMiddleware[]
|
||||||
|
@ -7,7 +7,7 @@ import { lambda } from './lambda'
|
|||||||
|
|
||||||
export const netlify: NitroPreset = extendPreset(lambda, {
|
export const netlify: NitroPreset = extendPreset(lambda, {
|
||||||
output: {
|
output: {
|
||||||
dir: '{{ _nuxt.rootDir }}/netlify/functions',
|
dir: '{{ _nuxt.rootDir }}/.netlify/functions-internal',
|
||||||
publicDir: '{{ _nuxt.rootDir }}/dist'
|
publicDir: '{{ _nuxt.rootDir }}/dist'
|
||||||
},
|
},
|
||||||
hooks: {
|
hooks: {
|
||||||
@ -24,6 +24,9 @@ export const netlify: NitroPreset = extendPreset(lambda, {
|
|||||||
contents = currentRedirects + '\n' + contents
|
contents = currentRedirects + '\n' + contents
|
||||||
}
|
}
|
||||||
await writeFile(redirectsPath, contents)
|
await writeFile(redirectsPath, contents)
|
||||||
|
},
|
||||||
|
'nitro:rollup:before' (ctx: NitroContext) {
|
||||||
|
ctx.rollupConfig.output.entryFileNames = 'server.ts'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ignore: [
|
ignore: [
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// @ts-ignore
|
import { builder } from '@netlify/functions'
|
||||||
import { builderFunction } from '@netlify/functions'
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { handler as _handler } from '#nitro/entries/lambda'
|
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