Add Cloudflare Pages support
This commit is contained in:
parent
97f7be04b9
commit
835e75519b
3 changed files with 17 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
import { defineConfig } from "astro/config";
|
import { defineConfig } from "astro/config";
|
||||||
|
|
||||||
|
import cloudflare from "@astrojs/cloudflare";
|
||||||
import netlify from "@astrojs/netlify/functions";
|
import netlify from "@astrojs/netlify/functions";
|
||||||
import node from "@astrojs/node";
|
import node from "@astrojs/node";
|
||||||
import vercel from "@astrojs/vercel/serverless";
|
import vercel from "@astrojs/vercel/serverless";
|
||||||
|
@ -11,6 +12,9 @@ if (process.env.VERCEL) {
|
||||||
} else if (process.env.NETLIFY) {
|
} else if (process.env.NETLIFY) {
|
||||||
console.debug("Using Netlify adapter");
|
console.debug("Using Netlify adapter");
|
||||||
astroAdapter = netlify();
|
astroAdapter = netlify();
|
||||||
|
} else if (process.env.CF_PAGES) {
|
||||||
|
console.debug("Using Cloudflare adapter");
|
||||||
|
astroAdapter = cloudflare();
|
||||||
} else {
|
} else {
|
||||||
console.debug("Using Node.js adapter");
|
console.debug("Using Node.js adapter");
|
||||||
astroAdapter = node({
|
astroAdapter = node({
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
},
|
},
|
||||||
"browserslist": "cover 95%, last 2 versions, Firefox ESR, not dead",
|
"browserslist": "cover 95%, last 2 versions, Firefox ESR, not dead",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@astrojs/cloudflare": "^6.2.1",
|
||||||
"@astrojs/netlify": "^2.2.0",
|
"@astrojs/netlify": "^2.2.0",
|
||||||
"@astrojs/node": "^5.1.0",
|
"@astrojs/node": "^5.1.0",
|
||||||
"@astrojs/vercel": "^3.2.1",
|
"@astrojs/vercel": "^3.2.1",
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
lockfileVersion: '6.0'
|
lockfileVersion: '6.0'
|
||||||
|
|
||||||
specifiers:
|
specifiers:
|
||||||
|
'@astrojs/cloudflare': ^6.2.1
|
||||||
'@astrojs/netlify': ^2.2.0
|
'@astrojs/netlify': ^2.2.0
|
||||||
'@astrojs/node': ^5.1.0
|
'@astrojs/node': ^5.1.0
|
||||||
'@astrojs/vercel': ^3.2.1
|
'@astrojs/vercel': ^3.2.1
|
||||||
|
@ -25,6 +26,7 @@ specifiers:
|
||||||
typescript: ^5.0.2
|
typescript: ^5.0.2
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@astrojs/cloudflare': 6.2.1_astro@2.1.3
|
||||||
'@astrojs/netlify': 2.2.0_astro@2.1.3
|
'@astrojs/netlify': 2.2.0_astro@2.1.3
|
||||||
'@astrojs/node': 5.1.0_astro@2.1.3
|
'@astrojs/node': 5.1.0_astro@2.1.3
|
||||||
'@astrojs/vercel': 3.2.1_astro@2.1.3
|
'@astrojs/vercel': 3.2.1_astro@2.1.3
|
||||||
|
@ -60,6 +62,16 @@ packages:
|
||||||
'@jridgewell/trace-mapping': 0.3.17
|
'@jridgewell/trace-mapping': 0.3.17
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@astrojs/cloudflare/6.2.1_astro@2.1.3:
|
||||||
|
resolution: {integrity: sha512-yIk6D0PKVOEyUR5px/oqMbkgDFoMPnwv+i9CzFY6r3FnNy+phhyuCxRkBIJumbTVgBo0j8j0fFmZ9ioGvCFXxg==}
|
||||||
|
peerDependencies:
|
||||||
|
astro: ^2.1.3
|
||||||
|
dependencies:
|
||||||
|
astro: 2.1.3_sass@1.59.3+sharp@0.31.3
|
||||||
|
esbuild: 0.15.18
|
||||||
|
tiny-glob: 0.2.9
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@astrojs/compiler/0.31.4:
|
/@astrojs/compiler/0.31.4:
|
||||||
resolution: {integrity: sha512-6bBFeDTtPOn4jZaiD3p0f05MEGQL9pw2Zbfj546oFETNmjJFWO3nzHz6/m+P53calknCvyVzZ5YhoBLIvzn5iw==}
|
resolution: {integrity: sha512-6bBFeDTtPOn4jZaiD3p0f05MEGQL9pw2Zbfj546oFETNmjJFWO3nzHz6/m+P53calknCvyVzZ5YhoBLIvzn5iw==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
Reference in a new issue