JSPM

@peektree/next-plugin

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 102
  • Score
    100M100P100Q59314F
  • License MIT

Next.js plugin for peek - live worktree switching

Package Exports

  • @peektree/next-plugin

Readme

@peektree/next-plugin

Next.js plugin for Peek — hot-swap branches without restarting your dev server.

Install

npm install -D @peektree/cli @peektree/next-plugin

Setup

// next.config.ts
import withPeek from '@peektree/next-plugin'

export default withPeek()({
  // your next config
})

Options

withPeek({
  port: 24789,   // WebSocket port (default: 24789)
  banner: true,  // Show status overlay (default: true)
  debug: false   // Log switch events (default: false)
})({
  // your next config
})

How It Works

  1. Plugin wraps Next.js middleware and webpack config
  2. WebSocket server listens for switch commands
  3. When you run peek sw feature-auth, the plugin triggers a full reload
  4. Status banner updates to show current branch

Browser Overlay

When active, Peek shows a status bar in your app:

  • Back: Return to main
  • Copy Scope: Grab context for AI
  • Status: HMR errors, switch confirmations

License

MIT