chore: use env

This commit is contained in:
KazooTTT
2025-01-30 20:36:06 +08:00
parent ad0e4a7af9
commit b0d0839391
2 changed files with 7 additions and 9 deletions

View File

@ -19,14 +19,7 @@ export default defineConfig({
mode: 'directory',
runtime: {
mode: process.env.NODE_ENV === 'production' ? 'off' : 'local',
persistTo: process.env.NODE_ENV === 'production' ? undefined : '.wrangler/state/v3/d1',
bindings: {
DB: {
type: 'd1',
databaseName: 'blog-pageviews',
databaseId: 'ab9e5f7d-e254-4e7d-bd85-5d944a622682'
}
}
persistTo: process.env.NODE_ENV === 'production' ? undefined : '.wrangler/state/v3/d1'
}
}),
redirects: {

View File

@ -10,3 +10,8 @@ format = "directory"
[site]
bucket = "./dist"
pages_build_output_dir = "dist"
[[d1_databases]]
binding = "DB"
database_name = "blog-pageviews"
database_id = "${D1_DATABASE_ID}"