@fluixi/vite-plugin

中文文档
1.0.0-alpha.108发布于 2026/11/07MITTypeScriptESM + CJS近 30 天下载 3532

Vite plugin for Fluixi — compiles JSX via @fluixi/compiler (jsx or imperative backend).

原始使用文档
文档目录6 节
  1. ✨ Overview
  2. 📦 Installation
  3. 🚀 Usage
  4. ⚙️ Options
  5. 🕸️ Reactive graph
  6. 📄 License

Fluixi

@fluixi/vite-plugin

The Vite plugin for Fluixi: compiles JSX and html `` templates.

License: MIT TypeScript npm Vite


✨ Overview

@fluixi/vite-plugin sets the esbuild jsxImportSource and runs the Fluixi compile (via @fluixi/compiler): JSX and html`...` both, straight into @fluixi/dom runtime calls. It rewrites the source in place, so output carries a source map and holes keep the text the author wrote. Nothing from babel is installed for it. @fluixi/core re-exports fluixi/createVitePlugin from here, and @fluixi/start wires it in automatically: use this plugin directly for a plain (non-meta-framework) Vite app.

📦 Installation

pnpm add -D @fluixi/vite-plugin

🚀 Usage

import { defineConfig } from 'vite';
import { fluixi } from '@fluixi/vite-plugin';

export default defineConfig({
  plugins: [
    // JSX and html`` templates both compile straight into @fluixi/dom runtime
    // calls (createNativeElement/spread/insert/…). No options required.
    fluixi(),
  ],
});

⚙️ Options

Options are @fluixi/compiler's CompilerOptions:

OptionDefaultWhat
importSource@fluixi/jsxwhere the JSX types come from; also the jsxImportSource given to esbuild
formatbothwhich syntaxes to compile: jsx, html, or both
signalModule / controlFlowModule@fluixi/domwhere emitted runtime symbols come from
resolve-rules that supply a component import from a bare tag
globalsfluixi.d.tswhere to write the generated ambient types (the resolved components and the $signal-style intrinsics). false skips it
propsDestructuretruerewrite a component's destructured props into property reads, so function Card({ title }) keeps updating. A pattern it can't prove is left as written. Turn off for a package that ships its source
templateClone / partialTemplatestrueclone static subtrees instead of building them
delegateEventstrueevent delegation
sourceMapstrueemit source maps
babelfalsecompile through the babel front-end instead, for a project whose own babel plugins have to see the output. Needs @babel/core, which is an optional peer
devtoolson in devserve the running app's reactive graph, and mark where each node was created. { external: true } marks dependencies too

🕸️ Reactive graph

The plugin adds a small agent to the page in development mode, which reports the reactive graph at GET /__fluixi/graph. This graph is available as plain JSON, making it easy to read and use in tools like editor extensions or panels. The agent comes with the plugin, so a project needs nothing else installed; only the framework itself is resolved from the project, since watching a second copy of the runtime would watch a graph nothing is using.

Here is how you can configure the plugin:

// vite.config.ts
plugins: [fluixi()],                            // graph on in dev
plugins: [fluixi({ devtools: false })],         // off
plugins: [fluixi({ devtools: { external: true } })],  // dependencies too

Each node in the graph carries the file, line, and column it was created at, named relative to the project root. By default, nodes from dependencies are not marked, which keeps the graph focused on the code you are editing.

The external option is useful for working on the framework itself. It marks nodes from node_modules and outside the project root as external, allowing you to see which nodes were created by libraries and which by your application. The application's call site takes precedence over the wrapper that created the node, so count appears as the line you wrote it on, not the line inside signal().

📄 License

MIT © Fluixi

版本与发布记录

@fluixi/vite-plugin 共发布 56 个版本,首次发布于 2026/07/10;过去 12 个月发布了 56 个版本。

版本发布日期距今
1.0.0-alpha.108latest2026/11/078 天前
1.0.0-alpha.1072026/11/0511 天前
1.0.0-alpha.1062026/11/0213 天前
1.0.0-alpha.1052026/11/0115 天前
1.0.0-alpha.1042026/11/0115 天前
1.0.0-alpha.1032026/10/2620 天前

关于 @fluixi/vite-plugin 的常见问题

@fluixi/vite-plugin 是什么?

Vite plugin for Fluixi — compiles JSX via @fluixi/compiler (jsx or imperative backend).

如何安装 @fluixi/vite-plugin?

在项目目录运行 npm install @fluixi/vite-plugin,或使用 pnpm add / yarn add / bun add。

@fluixi/vite-plugin 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fluixi/vite-plugin 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@fluixi/vite-plugin 可以商用吗?

@fluixi/vite-plugin 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fluixi/vite-plugin 的下载量有多少?

根据 npm 官方下载统计,@fluixi/vite-plugin 在 2026/10/15 – 2026/11/13 这 30 天内被下载 3,532 次,日均约 118 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fluixi/vite-plugin 还在维护吗?

最新版本 1.0.0-alpha.108 发布于 2026/11/07(8 天前);至今共发布 56 个版本,其中过去 12 个月发布了 56 个;首次发布于 2026/07/10。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。