Upgrade Wrangler CLI (that is used for web deployment) from v1 to v2
Add API_ORIGIN environment variable to /env/*.env files
Refactor scripts/web-deploy.js to a more generic scripts/cf.js Wrangler CLI wrapper
Tweak the build output folder for the web package, from web/dist/web + web/dist/workers to web/dist
Pro Tip: Use yarn web:cf to access Wrangler CLI, injecting the wrangler.toml file with the correct values for the target environment. For example:
# Update `SOME_API_KEY` secret in the `test` (default) and `prod` CF Workers environments. See /env/*.env
$ yarn web:cf secret put SOME_API_KEY --env=test
$ yarn web:cf secret put SOME_API_KEY --env=prod
# Access the streaming logs, connecting to the target CF Worker script
$ yarn web:cf tail --env=test
# Deploy web front-end to a CF Worker script named `proxy` (https://example.com)
$ yarn web:cf publish --env=prod
# Deploy web front-end to a CF Worker script named `proxy-test` (https://test.example.com)
$ yarn web:cf publish --env=test
# Deploy web front-end to a CF Worker script named `proxy-test-23` (https://23-test.example.com)
$ yarn web:cf publish --env=test --version=23
# See the full list of CF Workers CLI options
$ yarn web:cf --help
web
deployment) from v1 to v2API_ORIGIN
environment variable to/env/*.env
filesscripts/web-deploy.js
to a more genericscripts/cf.js
Wrangler CLI wrapperweb
package, fromweb/dist/web
+web/dist/workers
toweb/dist
Pro Tip: Use
yarn web:cf
to access Wrangler CLI, injecting thewrangler.toml
file with the correct values for the target environment. For example:https://developers.cloudflare.com/workers/wrangler/get-started/