Skip to content

Commit

Permalink
lambdaName not called index, fix nuxt#669
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabioni authored Apr 15, 2022
1 parent 90cf41d commit 2345042
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export async function build (opts: BuildOptions & { config: NuxtBuilderConfig })
}
const buildDir = nuxtConfigFile.buildDir ? path.relative(entrypointPath, nuxtConfigFile.buildDir) : '.nuxt'
const srcDir = nuxtConfigFile.srcDir ? path.relative(entrypointPath, nuxtConfigFile.srcDir) : '.'
const lambdaName = nuxtConfigFile.lambdaName ? nuxtConfigFile.lambdaName : 'index'
const lambdaName = nuxtConfigFile.lambdaName ? nuxtConfigFile.lambdaName : 'lambdaname' //we don't call it index, otherwise a pre-generated index.vue file is not reachable anymore
const usesServerMiddleware = config.internalServer !== undefined ? config.internalServer : !!nuxtConfigFile.serverMiddleware

await exec('nuxt', [
Expand Down Expand Up @@ -297,7 +297,7 @@ export async function build (opts: BuildOptions & { config: NuxtBuilderConfig })
{ src: `/${publicPath}.+`, headers: { 'Cache-Control': 'max-age=31557600' } },
...Object.keys(staticFiles).map(file => ({ src: `/${file}`, headers: { 'Cache-Control': 'max-age=31557600' } })),
{ handle: 'filesystem' },
{ src: '/(.*)', dest: '/index' }
{ src: '/(.*)', dest: '/' + lambdaName }
]
}
}

0 comments on commit 2345042

Please sign in to comment.