Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eight-feet-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/netlify': minor
---

Updating out directories for Netlify Functions
2 changes: 1 addition & 1 deletion packages/integrations/netlify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default defineConfig({

### dist

For Netlify Functions, we build to a `netlify` directory at the base of your project. In the case of Netlify Edge Functions, we build to a `dist` directory at the base of your project. To change this, use the `dist` option:
We build to a `dist` directory at the base of your project. To change this, use the `dist` option:

```js
import { defineConfig } from 'astro/config';
Expand Down
4 changes: 2 additions & 2 deletions packages/integrations/netlify/src/integration-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function netlifyFunctions({ dist }: NetlifyFunctionsOptions = {}): AstroIntegrat
if (dist) {
config.outDir = dist;
} else {
config.outDir = new URL('./netlify/', config.root);
config.outDir = new URL('./dist/', config.root);
}
},
'astro:config:done': ({ config, setAdapter }) => {
Expand All @@ -34,7 +34,7 @@ function netlifyFunctions({ dist }: NetlifyFunctionsOptions = {}): AstroIntegrat
'astro:build:start': async ({ buildConfig }) => {
entryFile = buildConfig.serverEntry.replace(/\.m?js/, '');
buildConfig.client = _config.outDir;
buildConfig.server = new URL('./functions/', _config.outDir);
buildConfig.server = new URL('./.netlify/functions-internal/', _config.root);
},
'astro:build:done': async ({ routes, dir }) => {
await createRedirects(routes, dir, entryFile, false);
Expand Down
5 changes: 4 additions & 1 deletion packages/integrations/netlify/test/functions/cookies.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ describe('Cookies', () => {
});

it('Can set multiple', async () => {
const entryURL = new URL('./fixtures/cookies/dist/functions/entry.mjs', import.meta.url);
const entryURL = new URL(
'./fixtures/cookies/.netlify/functions-internal/entry.mjs',
import.meta.url
);
const { handler } = await import(entryURL);
const resp = await handler({
httpMethod: 'POST',
Expand Down