@layerwise/vite
v0.1.8
Published
Vite plugins for Layerwise-generated apps.
Downloads
251
Readme
@layerwise/vite
Vite plugin used by Layerwise-generated projects during local preview. It runs only in Vite's development server and:
- loads the Layerwise preview client from the root route;
- adds
data-layerwise-sourcelocations to intrinsic JSX elements; - exposes element selection, annotation, navigation, browser logs, and preview agent bridges to the Layerwise app.
Usage
import { layerwise } from '@layerwise/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [layerwise()]
});Place layerwise() before the React and TanStack Start plugins so it can
instrument source JSX and prepend the preview client to routes/__root.tsx.
Development
~/Library/pnpm/pnpm --dir desktop/vite check-types
~/Library/pnpm/pnpm --dir desktop/vite test
~/Library/pnpm/pnpm --dir desktop/vite test:integration
~/Library/pnpm/pnpm --dir desktop/vite buildThe integration test starts a temporary Vite project and drives the system
Chrome. Follow AGENTS.md for testing workspace builds in the running Layerwise
preview and for the npm release sequence.
