1
0
forked from nixcn/nixcn-web

Impl cloudflare wrangler

- Add astro cloudlfare plugin
- Generate cloudflare deploy configs

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2025-12-09 17:21:41 +08:00
parent dc123b4ae4
commit faa00aa16c
5 changed files with 877 additions and 27 deletions

View File

@@ -3,6 +3,8 @@ import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight'; import starlight from '@astrojs/starlight';
import mdx from '@astrojs/mdx'; import mdx from '@astrojs/mdx';
import cloudflare from '@astrojs/cloudflare';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
integrations: [ integrations: [
@@ -35,4 +37,6 @@ export default defineConfig({
}), }),
mdx(), mdx(),
], ],
adapter: cloudflare(),
}); });

View File

@@ -10,6 +10,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"@astrojs/cloudflare": "^12.6.12",
"@astrojs/mdx": "^4.3.12", "@astrojs/mdx": "^4.3.12",
"@astrojs/starlight": "^0.37.0", "@astrojs/starlight": "^0.37.0",
"astro": "^5.6.1", "astro": "^5.6.1",

884
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

2
public/.assetsignore Normal file
View File

@@ -0,0 +1,2 @@
_worker.js
_routes.json

13
wrangler.jsonc Normal file
View File

@@ -0,0 +1,13 @@
{
"main": "dist/_worker.js/index.js",
"name": "nixcn-web",
"compatibility_date": "2025-12-09",
"compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"],
"assets": {
"binding": "ASSETS",
"directory": "./dist",
},
"observability": {
"enabled": true,
},
}