0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-17 22:44:24 -05:00

[ci] format

This commit is contained in:
ematipico 2023-09-06 04:46:18 +00:00 committed by astrobot-houston
parent 9ffa1a84e8
commit eb8c4cc2fc
2 changed files with 18 additions and 16 deletions

View file

@ -207,8 +207,7 @@ You can set functionPerRoute: false to prevent surpassing the limit.`
// Multiple entrypoint support // Multiple entrypoint support
if (_entryPoints.size) { if (_entryPoints.size) {
const getRouteFuncName = (route: RouteData) => const getRouteFuncName = (route: RouteData) => route.component.replace('src/pages/', '');
route.component.replace('src/pages/', '')
const getFallbackFuncName = (entryFile: URL) => const getFallbackFuncName = (entryFile: URL) =>
basename(entryFile.toString()) basename(entryFile.toString())
@ -218,7 +217,7 @@ You can set functionPerRoute: false to prevent surpassing the limit.`
for (const [route, entryFile] of _entryPoints) { for (const [route, entryFile] of _entryPoints) {
const func = route.component.startsWith('src/pages/') const func = route.component.startsWith('src/pages/')
? getRouteFuncName(route) ? getRouteFuncName(route)
: getFallbackFuncName(entryFile) : getFallbackFuncName(entryFile);
await createFunctionFolder(func, entryFile, filesToInclude, logger); await createFunctionFolder(func, entryFile, filesToInclude, logger);
routeDefinitions.push({ routeDefinitions.push({

View file

@ -16,7 +16,10 @@ describe('Serverless with dynamic routes', () => {
it('build successful', async () => { it('build successful', async () => {
expect(await fixture.readFile('../.vercel/output/static/index.html')).to.be.ok; expect(await fixture.readFile('../.vercel/output/static/index.html')).to.be.ok;
expect(await fixture.readFile('../.vercel/output/functions/[id]/index.astro.func/.vc-config.json')).to.be.ok; expect(
expect(await fixture.readFile('../.vercel/output/functions/api/[id].js.func/.vc-config.json')).to.be.ok; await fixture.readFile('../.vercel/output/functions/[id]/index.astro.func/.vc-config.json')
).to.be.ok;
expect(await fixture.readFile('../.vercel/output/functions/api/[id].js.func/.vc-config.json'))
.to.be.ok;
}); });
}); });