Change8

@cloudflare/vite-plugin@1.31.0

📦 cloudflare-workersView on GitHub →
1 features🐛 2 fixes1 deprecations🔧 3 symbols

Summary

This release introduces experimental headful browser rendering for local debugging and fixes a SyntaxError related to trailing comments in SSR-transformed modules. It also updates how the local workerd compatibility date is determined, deprecating the old utility function.

Migration Steps

  1. If you were using `getLocalWorkerdCompatibilityDate` from `@cloudflare/vite-plugin`, replace its usage with `new Date().toISOString().slice(0, 10)`.

✨ New Features

  • Added experimental headful browser rendering support for local development via the `X_BROWSER_HEADFUL` environment variable when running `wrangler dev` or `vite dev`.

🐛 Bug Fixes

  • Fixed a SyntaxError when SSR-transformed module ends with a single-line comment by ensuring a newline precedes the closing brace in `runInlinedModule`.
  • Normalized the return value of `getAssetsDirectory()` using `vite.normalizePath()` to guarantee `assets.directory` in the output `wrangler.json` uses forward slashes.

Affected Symbols

⚡ Deprecations

  • The re-exported `getLocalWorkerdCompatibilityDate` function from `@cloudflare/vite-plugin` is deprecated. Callers should use today's date directly, e.g., `new Date().toISOString().slice(0, 10)`.