@reticlehq/vite-plugin is one line in vite.config.ts that does the two things everyone forgets: injecting reticle.connect() and enabling source mapping. Install it if your app builds with Vite. On Next.js use @reticlehq/next instead; on any other bundler, wire @reticlehq/browser by hand.
Apache 2.0. Depends on @babel/core, @reticlehq/babel-plugin and @reticlehq/core. Optional peer dependency: vite >= 4.
Install and use
Why it exists
apply: 'serve' means it never reaches a production build. That is the guarantee that lets you leave it in the config permanently: there is no way to ship Reticle to your users by forgetting to remove a line.
What it injects
A virtual module at/@reticle-connect, added to the HTML, whose contents are:
src/reticle-dev.ts, .js, .tsx or .jsx, in that order, and leaves the file alone if you have one: that file is yours to edit.
Options
reticle(options?: ReticleVitePluginOptions): ReticleVitePlugin. Every option is optional.
Other exports
Types:
ReticleVitePluginOptions, ReticleVitePlugin, ViteDevServerLike.
Desktop
apply: 'serve' and opts the connect call into production.
Desktop wiring in full
Including the Tauri CSP whose failure is completely silent.