Skip to content

refactor: serve dev client modules instead of patching the vite client - #152

Open
samrum wants to merge 1 commit into
vite-8from
vite-8-dev-client
Open

refactor: serve dev client modules instead of patching the vite client#152
samrum wants to merge 1 commit into
vite-8from
vite-8-dev-client

Conversation

@samrum

@samrum samrum commented Jul 21, 2026

Copy link
Copy Markdown
Owner
  • Serve a wrapper module at /@vite/client that re-exports the real vite client (served at /@web-extension/vite-client) and wraps its exported updateStyle / removeStyle to support addStyleTarget style targets, replacing regex patching of the client source
  • Give the background service worker a dedicated minimal HMR client that reloads the extension on full-reload and after server restarts, instead of patching document guards and reload calls into the shared client
  • Replace DevBuilder watcher.on("change") registrations with the per-environment hotUpdate hook; content css rewrites now use the absolute file path, and additionalInputs html/styles are also rewritten on change
  • Replace the client-patching guard test with contract tests: vite client export names, and dev css modules importing style functions from /@vite/client

- Serve a wrapper module at /@vite/client that re-exports the real vite
  client (served at /@web-extension/vite-client) and wraps its exported
  updateStyle / removeStyle to support addStyleTarget style targets,
  replacing regex patching of the client source
- Give the background service worker a dedicated minimal HMR client that
  reloads the extension on full-reload and after server restarts, instead
  of patching document guards and reload calls into the shared client
- Replace DevBuilder watcher.on("change") registrations with the
  per-environment hotUpdate hook; content css rewrites now use the
  absolute file path, and additionalInputs html/styles are also rewritten
  on change
- Replace the client-patching guard test with contract tests: vite client
  export names, and dev css modules importing style functions from
  /@vite/client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant