Skip to content

Commit e1294c4

Browse files
authored
Netlify outdirectory (#3377)
* Change dist directory, and functions out directory * Add changeset * update docs * Fix changeset
1 parent e8007c3 commit e1294c4

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.changeset/fair-kangaroos-talk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/netlify': minor
3+
---
4+
5+
Change out directories on dist and serverEntry

packages/integrations/netlify/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default defineConfig({
3939

4040
### dist
4141

42-
We build to a `netlify` directory at the base of your project. To change this, use the `dist` option:
42+
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:
4343

4444
```js
4545
import { defineConfig } from 'astro/config';

packages/integrations/netlify/src/integration-edge-functions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export function netlifyEdgeFunctions({ dist }: NetlifyEdgeFunctionsOptions = {})
7272
if (dist) {
7373
config.outDir = dist;
7474
} else {
75-
config.outDir = new URL('./netlify/', config.root);
75+
config.outDir = new URL('./dist/', config.root);
7676
}
7777
},
7878
'astro:config:done': ({ config, setAdapter }) => {
@@ -82,7 +82,7 @@ export function netlifyEdgeFunctions({ dist }: NetlifyEdgeFunctionsOptions = {})
8282
'astro:build:start': async ({ buildConfig }) => {
8383
entryFile = buildConfig.serverEntry.replace(/\.m?js/, '');
8484
buildConfig.client = _config.outDir;
85-
buildConfig.server = new URL('./edge-functions/', _config.outDir);
85+
buildConfig.server = new URL('./.netlify/edge-functions/', _config.root);
8686
buildConfig.serverEntry = 'entry.js';
8787
},
8888
'astro:build:setup': ({ vite, target }) => {

0 commit comments

Comments
 (0)