@cloudflare/vite-plugin 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/asset-workers/asset-worker.js +186 -183
- package/dist/asset-workers/router-worker.js +78 -74
- package/dist/index.js +52 -18
- package/dist/runner-worker/index.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -466,6 +466,13 @@ The value of `MY_VAR` will therefore be `'Production var'`.
|
|
|
466
466
|
If you run `vite build --mode staging` then the 'staging' Vite mode will be used and the 'staging' Cloudflare environment will be selected.
|
|
467
467
|
The value of `MY_VAR` will therefore be `'Staging var'`.
|
|
468
468
|
|
|
469
|
+
## Secrets
|
|
470
|
+
|
|
471
|
+
Secrets can be provided to your Worker in local development using a [`.dev.vars`](https://developers.cloudflare.com/workers/configuration/secrets/#local-development-with-secrets) file. If you are using [Cloudflare Environments](#cloudflare-environments) then the relevant `.dev.vars` file will be selected. For example, `CLOUDFLARE_ENV=staging vite dev` will load `.dev.vars.staging` if it exists and fall back to `.dev.vars`.
|
|
472
|
+
|
|
473
|
+
> [!NOTE]
|
|
474
|
+
> The `vite build` command copies the relevant `.dev.vars[.env-name]` file to the output directory. This is only used when running `vite preview` and is not deployed with your Worker.
|
|
475
|
+
|
|
469
476
|
## Migrating from `wrangler dev`
|
|
470
477
|
|
|
471
478
|
Migrating from `wrangler dev` is a simple process and you can follow the instructions in the [Quick start](#quick-start) to get started.
|