[ci] format

This commit is contained in:
matthewp 2022-04-06 20:22:36 +00:00 committed by GitHub Actions
parent c6f8bce7c3
commit 340cc1c8e4
3 changed files with 11 additions and 8 deletions

View file

@ -16,7 +16,7 @@ function createRouteData(
// TODO bring back
generate: () => '',
pathname: pathname || undefined,
segments
segments,
};
}

View file

@ -54,7 +54,8 @@ function netlifyFunctions({ dist }: NetlifyFunctionsOptions = {}): AstroIntegrat
_redirects += `
${route.pathname} /.netlify/functions/${entryFile} 200`;
} else {
const pattern = '/' + route.segments.map(([part]) => part.dynamic ? '*' : part.content).join('/');
const pattern =
'/' + route.segments.map(([part]) => (part.dynamic ? '*' : part.content)).join('/');
_redirects += `
${pattern} /.netlify/functions/${entryFile} 200`;
}

View file

@ -16,16 +16,18 @@ describe('Dynamic pages', () => {
ssr: true,
},
adapter: netlifyAdapter({
dist: new URL('./fixtures/dynamic-route/dist/', import.meta.url)
dist: new URL('./fixtures/dynamic-route/dist/', import.meta.url),
}),
site: `http://example.com`,
vite: {
resolve: {
alias: {
'@astrojs/netlify/netlify-functions.js': fileURLToPath(new URL('../dist/netlify-functions.js', import.meta.url))
}
}
}
alias: {
'@astrojs/netlify/netlify-functions.js': fileURLToPath(
new URL('../dist/netlify-functions.js', import.meta.url)
),
},
},
},
});
await fixture.build();
});