Back

3.1.3前面可用,后续因为添加了sharp,cf 不支持,后续不更新

安装依赖

官方教程为npm,并不适用bun,本文将用bun替换npm vscode运行 bun install @astrojs/cloudflare 过程慢的要死,稍安勿躁 提示

PS C:\Users\TAOZI\Documents\GitHub\ASTRO-BLOG-2024> bun install @astrojs/cloudflare
[0.00ms] ".env"
bun add v1.1.30 (7996d06b)

+ @astrojs/node@8.3.2

installed @astrojs/cloudflare@11.1.0

5 packages installed [375.91s]
ts

即为成功

修改文件

按照官方教程修改astro.config.ts

import { defineConfig } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';

export default defineConfig({
  output: 'server',
  adapter: cloudflare()
});
plaintext

可以部署cf了

Astro Pure主题部署到cloudflare
https://blog.en.icu/blog/2024-10-25astro-pure主题部署到cloudflare
Author Xingluo
Published at October 25, 2024
Copyright CC BY-NC-SA 4.0
Comment seems to stuck. Try to refresh?✨