Wrangler defaults to persisting state to .wrangler/state/v3 in the config directory. This can be overridden with the --persist-to CLI flag. We have a few options:
Persist state to.wrangler/state/v3 by default and add a persistTo option to the plugin config to override this.
Make state persistence opt-in (determined by whether the user provides the persistTo option in the plugin config).
Option 1 but also accept false as a value for persistTo in order to opt out.
Option 2 but also accept true as a value for persistTo in order to persist state to .wrangler/state/v3.
I'm most in favour of options 1 or 3 because they mirror the behaviour of wrangler dev. Users will still need to run Wrangler CLI commands when using the Vite plugin and the behaviour would be unexpected if they don't persist state to the same directory. It could be useful to opt out though (as in option 3), particularly for testing.
What do you think @IgorMinar @petebacondarwin @dario-piotrowicz?
Wrangler defaults to persisting state to
.wrangler/state/v3
in the config directory. This can be overridden with the--persist-to
CLI flag. We have a few options:.wrangler/state/v3
by default and add apersistTo
option to the plugin config to override this.persistTo
option in the plugin config).false
as a value forpersistTo
in order to opt out.true
as a value forpersistTo
in order to persist state to.wrangler/state/v3
.I'm most in favour of options 1 or 3 because they mirror the behaviour of
wrangler dev
. Users will still need to run Wrangler CLI commands when using the Vite plugin and the behaviour would be unexpected if they don't persist state to the same directory. It could be useful to opt out though (as in option 3), particularly for testing.What do you think @IgorMinar @petebacondarwin @dario-piotrowicz?