npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@actview/plugin-vite

v1.3.0

Published

ActView 的 Vite 插件:v1 defineComponent 转换 + v2 React 语义 JSX(@actview/plugin-jsx)

Readme

@actview/plugin-vite

ActView v2 的 Vite 插件 —— actviewJsxPlugin() 将 .tsx / .ts / .jsx / .js 过 Babel(@actview/plugin-jsx):React 语义 JSX 编译(直出 createVNode)+ 自动 defineComponent 包装。

核心功能

  • React 语义 JSX:className / htmlFor / onChange 映射、dangerouslySetInnerHTML、v-model 等指令属性
  • 自动组件包装:function App() { return () => <JSX/> } 免手动 defineComponent(React 函数组件语义)
  • node_modules 硬排除:依赖走 esbuild 预构建管线(@actview/plugin-babel 宿主壳)
  • 性能:模块级只创建一次 Babel ConfigItem

安装

pnpm add -D @actview/plugin-vite

快速开始

vite.config.ts:

import { defineConfig } from 'vite'
import { actviewJsxPlugin } from '@actview/plugin-vite'

export default defineConfig({
  plugins: [actviewJsxPlugin()],
})

配 scoped CSS 时注意顺序——scoped 插件在前(先注入 data-v-* 属性,JSX 源码形态),JSX 编译在后(保留注入属性):

import { defineConfig } from 'vite'
import { actviewJsxPlugin } from '@actview/plugin-vite'
import { actviewScopedPlugin } from '@actview/plugin-scoped'

export default defineConfig({
  plugins: [...actviewScopedPlugin(), actviewJsxPlugin()],
})

tsconfig.json 配 jsxImportSource: "actview"。之后 .tsx 中即可用 React 语义写组件,运行时为 vue。

API

| 导出 | 说明 | |---|---| | actviewJsxPlugin(options?)(默认导出同) | Vite 插件:{ name: 'actview-v2-jsx', enforce: 'pre', transform };options.babel 透传宿主壳排除规则(include/exclude) |

依赖关系

  • @actview/plugin-jsx(React 语义 JSX 编译)
  • @actview/plugin-babel(babel 宿主壳)
  • peerDependencies:vite ^6.0.0 || ^7.0.0 || ^8.0.0(必需)

开发

pnpm build   # tsup 打包 dist
pnpm test    # 走根目录 vitest(test/v2 集成)

License

MIT