flarelabs-net / vite-plugin-cloudflare

12 stars 1 forks source link

Add state persistence #26

Closed jamesopstad closed 1 month ago

jamesopstad commented 1 month ago

resolves #21

This PR adds state persistence. By default, state is persisted to .wrangler/state/v3 in the same directory as the Vite config. This matches the default behaviour of Wrangler. A new persistTo option has also been added to the plugin config. If a string is provided then this is used as the persistence directory. If false is provided then state is not persisted between runs of the dev server.

I have set persistTo to false in the integration tests.