-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Netlify adapter * Remove package.json export that doesnt exist * Fix out path * Make netlifyFunctions the default * Make the dist configurable * Add an export for the functions * Append of the file exists
- Loading branch information
Showing
19 changed files
with
290 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
'astro': patch | ||
'@astrojs/netlify': patch | ||
'@astrojs/node': patch | ||
--- | ||
|
||
Netlify Adapter | ||
|
||
This change adds a Netlify adapter that uses Netlify Functions. You can use it like so: | ||
|
||
```js | ||
import { defineConfig } from 'astro/config'; | ||
import netlify from '@astrojs/netlify'; | ||
|
||
export default defineConfig({ | ||
adapter: netlify() | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "@astrojs/netlify", | ||
"description": "Deploy your site to Netlify", | ||
"version": "0.0.1", | ||
"type": "module", | ||
"types": "./dist/index.d.ts", | ||
"author": "withastro", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/withastro/astro.git", | ||
"directory": "packages/integrations/netlify" | ||
}, | ||
"bugs": "https://github.com/withastro/astro/issues", | ||
"homepage": "https://astro.build", | ||
"exports": { | ||
".": "./dist/index.js", | ||
"./functions": "./dist/integration-functions.js", | ||
"./netlify-functions.js": "./dist/netlify-functions.js", | ||
"./package.json": "./package.json" | ||
}, | ||
"scripts": { | ||
"build": "astro-scripts build \"src/**/*.ts\" && tsc", | ||
"dev": "astro-scripts dev \"src/**/*.ts\"" | ||
}, | ||
"dependencies": { | ||
"@astrojs/webapi": "^0.11.0" | ||
}, | ||
"devDependencies": { | ||
"@netlify/functions": "^1.0.0", | ||
"astro": "workspace:*", | ||
"astro-scripts": "workspace:*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# @astrojs/netlify | ||
|
||
Deploy your server-side rendered (SSR) Astro app to [Netlify](https://www.netlify.com/). | ||
|
||
Use this adapter in your Astro configuration file: | ||
|
||
```js | ||
import { defineConfig } from 'astro/config'; | ||
import netlify from '@astrojs/netlify/functions'; | ||
|
||
export default defineConfig({ | ||
adapter: netlify() | ||
}); | ||
``` | ||
|
||
After you build your site the `netlify/` folder will contain [Netlify Functions](https://docs.netlify.com/functions/overview/) in the `netlify/functions/` folder. | ||
|
||
Now you can deploy! | ||
|
||
```shell | ||
netlify deploy | ||
``` | ||
|
||
## Configuration | ||
|
||
The output folder is configuration with the `dist` property when creating the adapter. | ||
|
||
```js | ||
import { defineConfig } from 'astro/config'; | ||
import netlify from '@astrojs/netlify/functions'; | ||
|
||
export default defineConfig({ | ||
adapter: netlify({ | ||
dist: new URL('./dist/', import.meta.url) | ||
}) | ||
}); | ||
``` | ||
And then point to the dist in your `netlify.toml`: | ||
```toml | ||
[functions] | ||
directory = "dist/functions" | ||
``` |
Oops, something went wrong.