From 3887da26d0ce8faed79d5dbda01a6b5c147125d4 Mon Sep 17 00:00:00 2001 From: javayhu Date: Tue, 6 May 2025 23:42:16 +0800 Subject: [PATCH] chore: update wrangler config & add minify --- wrangler.jsonc | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/wrangler.jsonc b/wrangler.jsonc index 1f67107..ce59919 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -1,12 +1,49 @@ +/** + * For more details on how to configure Wrangler, refer to: + * https://developers.cloudflare.com/workers/wrangler/configuration/ + */ { "$schema": "node_modules/wrangler/config-schema.json", "main": ".open-next/worker.js", "name": "mksaas-template", "compatibility_date": "2024-12-30", - "compatibility_flags": ["nodejs_compat"], + "compatibility_flags": [ + "nodejs_compat", + "nodejs_compat_populate_process_env" + ], + // Minification helps to keep the Worker bundle size down and improve start up time. + "minify": true, "assets": { - "directory": ".open-next/assets", - "binding": "ASSETS" + "binding": "ASSETS", + "directory": ".open-next/assets" }, + "observability": { + "enabled": true + }, + + /** + * Smart Placement + * Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement + */ + "placement": { "mode": "smart" }, + + /** + * Bindings + * Bindings allow your Worker to interact with resources on the Cloudflare Developer Platform, including + * databases, object storage, AI inference, real-time communication and more. + * https://developers.cloudflare.com/workers/runtime-apis/bindings/ + */ + + /** + * Environment Variables + * https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables + */ + "vars": {}, + + /** + * Note: Use secrets to store sensitive data. + * https://developers.cloudflare.com/workers/configuration/secrets/ + */ + "kv_namespaces": [] }