@cloudflare/vite-plugin 0.0.0-fd5a45520 → 0.0.0-fd9dff833
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 +16 -0
- package/dist/asset-workers/asset-worker.js +1583 -1724
- package/dist/asset-workers/router-worker.js +1279 -1583
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7708 -537
- package/dist/runner-worker/index.js +7 -2
- package/package.json +20 -12
package/README.md
CHANGED
|
@@ -140,6 +140,15 @@ The `directory` in the output configuration will automatically point to the clie
|
|
|
140
140
|
> This output file is a snapshot of your configuration at the time of the build and is modified to reference your build artifacts.
|
|
141
141
|
> It is the configuration that is used for preview and deployment.
|
|
142
142
|
|
|
143
|
+
#### Update the .gitignore file
|
|
144
|
+
|
|
145
|
+
Wrangler will use and/or generate temporary files that should not be stored in git. Add the following lines to the `.gitignore` file:
|
|
146
|
+
|
|
147
|
+
```gitignore
|
|
148
|
+
.wrangler
|
|
149
|
+
.dev.vars
|
|
150
|
+
```
|
|
151
|
+
|
|
143
152
|
#### Run the development server
|
|
144
153
|
|
|
145
154
|
Run `npm run dev` to verify that your application is working as expected.
|
|
@@ -466,6 +475,13 @@ The value of `MY_VAR` will therefore be `'Production var'`.
|
|
|
466
475
|
If you run `vite build --mode staging` then the 'staging' Vite mode will be used and the 'staging' Cloudflare environment will be selected.
|
|
467
476
|
The value of `MY_VAR` will therefore be `'Staging var'`.
|
|
468
477
|
|
|
478
|
+
## Secrets
|
|
479
|
+
|
|
480
|
+
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`.
|
|
481
|
+
|
|
482
|
+
> [!NOTE]
|
|
483
|
+
> 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.
|
|
484
|
+
|
|
469
485
|
## Migrating from `wrangler dev`
|
|
470
486
|
|
|
471
487
|
Migrating from `wrangler dev` is a simple process and you can follow the instructions in the [Quick start](#quick-start) to get started.
|