cloudflare pages发布静态站点 wrangler设置

构建命令

# 将所有静态文件放根目录下
npx wrangler deploy --assets ./ --name site_name --compatibility-date 2025-12-10

# 将所有的静态文件放 **html** 目录下
npx wrangler deploy --assets ./html  --name site_name --compatibility-date 2025-12-11

.gitignore

Cloudflare Pages 默认会遵循 .gitignore 规则。创建或更新 .gitignore 文件:

node_modules/
.env*
*.log
.DS_Store
Thumbs.db
.git/
*.local

# 添加你想要排除的其他文件夹
dist/
build/
test/
coverage/
.idea/
.vscode/

作者:spike

分类: Tool

创作时间:2025-12-27

更新时间:2025-12-29