@llui/vite-plugin
v0.5.6
Published
LLui compiler — Vite plugin for compile-time bitmask optimization, template cloning, and source maps
Maintainers
Readme
@llui/vite-plugin
Vite plugin compiler for LLui. 3-pass TypeScript transform that eliminates the virtual DOM at compile time.
pnpm add -D @llui/vite-pluginSetup
// vite.config.ts
import { defineConfig } from 'vite'
import llui from '@llui/vite-plugin'
export default defineConfig({
plugins: [llui()],
})Options
llui({
mcpPort: 5200, // MCP debug server port (default: 5200, false to disable)
agent: true, // Emit LLui Agent metadata in prod builds (default: false)
})mcpPort— MCP debug bridge port. Default5200. Set tofalseto disable.agent— Opt into emitting schemas + binding descriptors in prod builds. Required when the app is deployed with@llui/agent/client. Defaultfalse(metadata is dev-only to keep production bundle size minimal).
What It Does
The compiler runs 3 passes over every .ts/.tsx file using the TypeScript Compiler API:
| Pass | Name | Description |
| ---- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1 | Prop split | Rewrites element helpers to elSplit()/elTemplate() for template cloning. Separates static props (set once at mount) from dynamic props (updated on state change). |
| 2 | Mask injection | Analyzes state dependencies, assigns bitmask bits to state paths, injects __dirty(oldState, newState) per component. Rewrites text() and binding callbacks with mask guards. |
| 3 | Import cleanup | Removes unused imports introduced or made redundant by earlier passes. |
Diagnostics
Static analysis lives in @llui/eslint-plugin. The compiler used to emit
its own warnings during transform(); those have all migrated to ESLint
rules so they surface as editor squiggles instead of build-time console
output. Install the plugin and enable its recommended config to get the
full set — empty-props, namespace-import, spread-in-children,
map-on-state-array, exhaustive-update, accessibility,
controlled-input, bitmask-overflow, static-on,
subapp-requires-reason, and the agent-* annotation rules.
