@nexus_js/vite-plugin-nexus
v0.9.2
Published
Official Vite plugin for Nexus — transforms .nx files, HMR, island manifests, Server Actions
Maintainers
Readme
@nexus_js/vite-plugin-nexus
Official Vite plugin for Nexus — transforms .nx files, HMR, island manifests, Server Actions.
Documentation
All guides, API reference, and examples live on nexusjs.dev.
Scoped CSS HMR (Vite dev)
When you save a .nx file that contains a <style> block, the plugin:
- Recompiles on the server and emits a Vite custom event
nexus:style-updatewith{ hash, css, filepath }—hashiscomponentHash(filepath)and matches[data-nx="…"]in the compiled template. - Injects a small client bridge (via
index.htmlin dev) that listens onimport.meta.hotand updates or appends<style data-nx-style-scope="…">so styles can refresh without a full page reload. Runes / island state stay warm when the rest of the pipeline cooperates.
Disable automatic injection with nexus({ styleBridge: false }) and import virtual:nexus-style-bridge yourself if you prefer.
Links
- Website: https://nexusjs.dev
- Install:
pnpm add -D @nexus_js/vite-plugin-nexus(published under the same@nexus_jsscope as the rest of the framework). - Repository: github.com/bierfor/nexus (see
packages/vite-plugin-nexus/) - Issues: github.com/bierfor/nexus/issues
License
MIT © Nexus contributors
