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

@uni_toolkit/vite-plugin-component-insight

v0.1.0

Published

一个用于 uni-app Vue3 项目的 Vite 插件,用于分析组件被哪些页面使用、使用了多少次,并结合主包与分包关系在控制台输出建议。

Readme

@uni_toolkit/vite-plugin-component-insight

一个用于 uni-app Vue3 项目的 Vite 插件,用于分析组件被哪些页面使用、使用了多少次,并结合主包与分包关系在控制台输出建议。

功能特性

  • 分析组件被哪些页面使用
  • 基于构建产物中的 usingComponents 统计组件依赖次数,包含嵌套组件链路
  • 结合主包和分包信息生成建议
  • 默认在控制台直接输出分析结果和建议
  • 按需输出 Markdown 报告,便于归档和二次处理
  • 兼容 uni-app Vue3 小程序构建流程,支持 easycom 解析结果

安装

npm install @uni_toolkit/vite-plugin-component-insight -D
# 或
pnpm add @uni_toolkit/vite-plugin-component-insight -D
# 或
yarn add @uni_toolkit/vite-plugin-component-insight -D

使用方法

import { defineConfig } from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
import componentInsight from '@uni_toolkit/vite-plugin-component-insight';

export default defineConfig({
  plugins: [
    uni(),
    componentInsight(),
  ],
});

插件默认不会生成文件,会在控制台直接输出分析结果和建议。

如果需要输出 Markdown,可以这样配置:

componentInsight({
  reportMarkdownPath: 'logs/component-insight-report.md',
})

如果只想生成 Markdown、不输出控制台,可以这样配置:

componentInsight({
  logToConsole: false,
  reportMarkdownPath: 'logs/component-insight-report.md',
})

配置项

interface VitePluginComponentInsightOptions {
  reportMarkdownPath?: string;
  logToConsole?: boolean;
  exclude?: ReadonlyArray<string | RegExp> | string | RegExp | null;
  include?: ReadonlyArray<string | RegExp> | string | RegExp | null;
}
  • reportMarkdownPath: 自定义 Markdown 报告输出路径,不传则不生成 Markdown
  • logToConsole: 是否输出控制台日志,默认开启
  • exclude: 指定过滤的文件,默认过滤 node_modules 和 uni_modules
  • include: 指定包含的文件, 默认为空

许可证

MIT