Skip to content

Conversation

@laulauland
Copy link

@laulauland laulauland commented Jan 22, 2026

Hiya, big fan of the agentation plugin! Hope you don't mind the unsolicited PR - I just built this for myself as I mostly work in Vite-land and figured a Vite plugin might be useful for someone else too.

Happy to also keep it in a separate repo if you prefer!

What changes

New package: vite-plugin-agentation

A Vite plugin that automatically injects Agentation during development. It works by:

  1. Hooking into Vite's HTML transformation
  2. Injecting a script that creates a container and mounts the Agentation component
  3. Only running in dev mode (apply: 'serve'), so production builds are unaffected

Usage:

// vite.config.ts
import agentation from 'vite-plugin-agentation'

export default defineConfig({
  plugins: [react(), agentation()]
})

Build setup

  • Uses tsup for consistency with the main agentation package
  • tsconfig.json aligned with main package conventions
  • Declares agentation as peer dependency so npm/pnpm warns if missing

HMR handling

  • Properly cleans up React root on HMR dispose
  • Removes container element before remounting

Documentation updates

  • Added README for the vite-plugin package explaining how it works, options, and when to use it vs direct import
  • Updated main README with Vite plugin installation section
  • Added "Vite plugin (alternative)" section to the install page on agentation.dev

Commits

  1. Add vite-plugin-agentation package to workspace – plugin source, package.json, tsconfig, workspace config
  2. Add vite-plugin documentation – README for plugin, updates to main README and docs site
  3. Align vite-plugin build config with main package – switch to tsup, align tsconfig
  4. Fix plugin code issues – add agentation peer dep, remove dead code, add HMR cleanup

- Add README for vite-plugin package with usage, options, and how it works
- Update main README with Vite plugin installation section
- Add Vite plugin section to install page on docs site
@vercel
Copy link

vercel bot commented Jan 22, 2026

@laulauland is attempting to deploy a commit to the Benji Taylor's Projects Team on Vercel.

A member of the Team first needs to authorize it.

- Switch from tsc to tsup for consistency
- Add tsup.config.ts with ESM output
- Update tsconfig.json to match main package conventions
- Add agentation as peer dependency for proper npm/pnpm warnings
- Remove unused server variable and ViteDevServer import
- Add proper HMR cleanup with import.meta.hot.dispose
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