chore: try to use zeabur adapter instead.

This commit is contained in:
Yufan Sheng 2024-07-18 11:01:03 +08:00
parent fd690aff57
commit 4673e7c420
Signed by: syhily
GPG Key ID: 9D18A22A7DCD5A9B
5 changed files with 2276 additions and 358 deletions

View File

@ -1,5 +1,5 @@
import mdx from '@astrojs/mdx';
import node from '@astrojs/node';
import zeabur from '@zeabur/astro-adapter/serverless';
import { uploader } from 'astro-uploader';
import { defineConfig, envField } from 'astro/config';
import rehypeExternalLinks from 'rehype-external-links';
@ -47,9 +47,7 @@ export default defineConfig({
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY as string,
}),
],
adapter: node({
mode: 'standalone',
}),
adapter: zeabur(),
markdown: {
gfm: true,
shikiConfig: {

2606
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -31,6 +31,7 @@
"dev": "astro dev",
"lint": "biome check --write --use-server . && prettier . --write",
"prepare": "npx husky",
"postinstall": "patch-package",
"preview": "astro preview",
"start": "astro dev"
},
@ -42,8 +43,8 @@
},
"dependencies": {
"@astrojs/mdx": "^3.1.2",
"@astrojs/node": "^8.3.2",
"@astrojs/rss": "^4.0.7",
"@zeabur/astro-adapter": "^1.0.5",
"astro": "^4.11.6",
"drizzle-orm": "^0.32.0",
"fuse.js": "^7.0.0",
@ -67,6 +68,7 @@
"aplayer": "^1.10.1",
"astro-uploader": "^1.1.3",
"bootstrap": "^5.3.3",
"patch-package": "^8.0.0",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-astro-organize-imports": "^0.4.9",

View File

@ -0,0 +1,16 @@
diff --git a/node_modules/@zeabur/astro-adapter/dist/serverless/entrypoint.js b/node_modules/@zeabur/astro-adapter/dist/serverless/entrypoint.js
index 6eaac22..79eb1fc 100644
--- a/node_modules/@zeabur/astro-adapter/dist/serverless/entrypoint.js
+++ b/node_modules/@zeabur/astro-adapter/dist/serverless/entrypoint.js
@@ -2,6 +2,11 @@ import { App } from "astro/app";
import { applyPolyfills } from "astro/app/node";
import { ASTRO_LOCALS_HEADER } from "./adapter.js";
import { getRequest, setResponse } from "./request-transform.js";
+
+await import('astro/env/setup')
+ .then((mod) => mod.setGetEnv((key) => process.env[key]))
+ .catch(() => {});
+
applyPolyfills();
const createExports = (manifest) => {
const app = new App(manifest);