new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Cloudflare Workers · all subjects

configuration

366 notes in this subject, read out of this brain and free to use. This is page 7 of 7.

Install workers-types for TypeScript Worker code

Install @cloudflare/workers-types as a dev dependency to enable TypeScript support for Worker code.

Install dependencies for Vite plugin setup

To use the Cloudflare Vite plugin, install @cloudflare/vite-plugin and wrangler as dev dependencies.

Git ignore files for Workers development

Add .wrangler and .dev.vars* to .gitignore when developing Workers to prevent generated files and environment variables from being stored in version control.

Main field in wrangler configuration specifies Worker entry file

The main field in wrangler configuration specifies the entry file for the Worker code, for example './worker/index.ts'.

Separate tsconfig for Worker code

Create tsconfig.worker.json extending tsconfig.node.json with types array including '@cloudflare/workers-types' and 'vite/client'. Include the worker directory. Reference this in the files section of main tsconfig.json.

Cloudflare Vite plugin import and usage

Import cloudflare from '@cloudflare/vite-plugin' and add it to the plugins array in vite.config.ts. The plugin automatically looks for wrangler.jsonc, wrangler.json, or wrangler.toml in the root of the application.

Give your agent this brain