Workers Sites configuration
Workers Sites require the latest version of Wrangler ↗.
There are a few specific configuration settings for Workers Sites in your Wrangler file:
-
bucketrequired- The directory containing your static assets, path relative to your Wrangler configuration file. Example:
bucket = "./public".
- The directory containing your static assets, path relative to your Wrangler configuration file. Example:
-
includeoptional- A list of gitignore-style patterns for files or directories in
bucketyou exclusively want to upload. Example:include = ["upload_dir"].
- A list of gitignore-style patterns for files or directories in
-
excludeoptional- A list of gitignore-style patterns for files or directories in
bucketyou want to exclude from uploads. Example:exclude = ["ignore_dir"].
- A list of gitignore-style patterns for files or directories in
To learn more about the optional include and exclude fields, refer to Ignoring subsets of static assets.
Example of a Wrangler configuration file:
{ "$schema": "./node_modules/wrangler/config-schema.json", "name": "docs-site-blah", "site": { "bucket": "./public" }, "env": { "production": { "name": "docs-site", "route": "https://example.com/docs*" }, "staging": { "name": "docs-site-staging", "route": "https://staging.example.com/docs*" } }}name = "docs-site-blah"
[site]bucket = "./public"
[env.production]name = "docs-site"route = "https://example.com/docs*"
[env.staging]name = "docs-site-staging"route = "https://staging.example.com/docs*"For very exceptionally large pages, Workers Sites might not work for you. There is a 25 MiB limit per page or file.
Workers Sites require Wrangler ↗ - make sure to use the latest version.
There are cases where users may not want to upload certain static assets to their Workers Sites. In this case, Workers Sites can also be configured to ignore certain files or directories using logic similar to Cargo's optional include and exclude fields ↗.
This means that you should use gitignore semantics when declaring which directory entries to include or ignore in uploads.
If you want to include only a certain set of files or directories in your bucket, you can add an include field to your [site] section of your Wrangler file:
{ "$schema": "./node_modules/wrangler/config-schema.json", "site": { "bucket": "./public", "include": [ "included_dir" ] }}[site]bucket = "./public"include = ["included_dir"] # must be an array.Wrangler will only upload files or directories matching the patterns in the include array.
If you want to exclude files or directories in your bucket, you can add an exclude field to your [site] section of your Wrangler file:
{ "$schema": "./node_modules/wrangler/config-schema.json", "site": { "bucket": "./public", "exclude": [ "excluded_dir" ] }}[site]bucket = "./public"exclude = ["excluded_dir"] # must be an array.Wrangler will ignore files or directories matching the patterns in the exclude array when uploading assets to Workers KV.
If you provide both include and exclude fields, the include field will be used and the exclude field will be ignored.
Wrangler will always ignore:
node_modules- Hidden files and directories
- Symlinks
Learn more about the standard patterns used for include and exclude in the gitignore documentation ↗.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-