Skip to content

Commit

Permalink
Netlify outdirectory (#3377)
Browse files Browse the repository at this point in the history
* Change dist directory, and functions out directory

* Add changeset

* update docs

* Fix changeset
  • Loading branch information
sarahetter authored May 16, 2022
1 parent e8007c3 commit e1294c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/fair-kangaroos-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/netlify': minor
---

Change out directories on dist and serverEntry
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

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

```js
import { defineConfig } from 'astro/config';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function netlifyEdgeFunctions({ dist }: NetlifyEdgeFunctionsOptions = {})
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 @@ -82,7 +82,7 @@ export function netlifyEdgeFunctions({ dist }: NetlifyEdgeFunctionsOptions = {})
'astro:build:start': async ({ buildConfig }) => {
entryFile = buildConfig.serverEntry.replace(/\.m?js/, '');
buildConfig.client = _config.outDir;
buildConfig.server = new URL('./edge-functions/', _config.outDir);
buildConfig.server = new URL('./.netlify/edge-functions/', _config.root);
buildConfig.serverEntry = 'entry.js';
},
'astro:build:setup': ({ vite, target }) => {
Expand Down

0 comments on commit e1294c4

Please sign in to comment.