[ci] format
This commit is contained in:
parent
c6f8bce7c3
commit
340cc1c8e4
3 changed files with 11 additions and 8 deletions
|
@ -16,7 +16,7 @@ function createRouteData(
|
||||||
// TODO bring back
|
// TODO bring back
|
||||||
generate: () => '',
|
generate: () => '',
|
||||||
pathname: pathname || undefined,
|
pathname: pathname || undefined,
|
||||||
segments
|
segments,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,8 @@ function netlifyFunctions({ dist }: NetlifyFunctionsOptions = {}): AstroIntegrat
|
||||||
_redirects += `
|
_redirects += `
|
||||||
${route.pathname} /.netlify/functions/${entryFile} 200`;
|
${route.pathname} /.netlify/functions/${entryFile} 200`;
|
||||||
} else {
|
} else {
|
||||||
const pattern = '/' + route.segments.map(([part]) => part.dynamic ? '*' : part.content).join('/');
|
const pattern =
|
||||||
|
'/' + route.segments.map(([part]) => (part.dynamic ? '*' : part.content)).join('/');
|
||||||
_redirects += `
|
_redirects += `
|
||||||
${pattern} /.netlify/functions/${entryFile} 200`;
|
${pattern} /.netlify/functions/${entryFile} 200`;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,16 +16,18 @@ describe('Dynamic pages', () => {
|
||||||
ssr: true,
|
ssr: true,
|
||||||
},
|
},
|
||||||
adapter: netlifyAdapter({
|
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`,
|
site: `http://example.com`,
|
||||||
vite: {
|
vite: {
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@astrojs/netlify/netlify-functions.js': fileURLToPath(new URL('../dist/netlify-functions.js', import.meta.url))
|
'@astrojs/netlify/netlify-functions.js': fileURLToPath(
|
||||||
}
|
new URL('../dist/netlify-functions.js', import.meta.url)
|
||||||
}
|
),
|
||||||
}
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
await fixture.build();
|
await fixture.build();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue