@vui-rs/vite-plugin
v0.1.3
Published
Vite plugin to compile .vue SFCs for the vui-rs custom renderer — element tags, a TUI v-model transform, and style-block stripping.
Maintainers
Readme
@vui-rs/vite-plugin
Vite plugin to compile .vue Single-File Components for the vui-rs custom renderer. It wraps @vitejs/plugin-vue with the TUI-specific adjustments: vui element tags (<box>/<text>/…), a v-model transform for the terminal input contract, and <style>-block stripping (a TUI has no CSS).
Build-time only — runs in the Vite/Rollup process, adds no runtime/FFI surface.
Install
bun add -d @vui-rs/vite-plugin viteUsage
// vite.config.ts
import { defineConfig } from "vite";
import { vuiVitePlugin } from "@vui-rs/vite-plugin";
export default defineConfig({
plugins: [vuiVitePlugin()],
resolve: { alias: { vue: "@vue/runtime-core" } },
build: {
target: "esnext",
lib: { entry: "main.ts", formats: ["es"], fileName: () => "app.js" },
rollupOptions: { external: [/^bun:/, /^node:/, /^@vui-rs\//, /^@vue\//] },
},
});Then run the built bundle with Bun: vite build && bun dist/app.js.
Pass { customElements: ["my-tag"] } for tags registered at runtime via extend().
License
MIT
