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

code-inspect-plugin-react

v0.0.3

Published

Webpack / Vite + TypeScript DOM 溯源源码工具

Readme

code-inspect-plugin-react

Webpack(ts-loader)或 Vite 下为 JSX/TSX 自动注入 data-insp-path(项目根相对路径 + 行号),便于从页面 DOM 溯源到源码。

安装

npm i code-inspect-plugin-react -D

构建(与 code-inspect-plugin-react 一致)

源码在 src/,发布物在 dist/

npm run build

使用 tsc -p tsconfig.build.json,并对 ts-loader-bootstrap 单独 esbuild 产出 dist/ts-loader-bootstrap.cjs(供 thread-loader 场景按路径加载)。

本地 file: 依赖与 node_modules 里为什么有 src/

package.jsonfiles 已限定发布物为 dist/README.mdnpm pack 仅包含这些 + package.json)。

若宿主使用 file:../code-inspect-plugin-react,npm 默认会软链整个本地目录,因此会看到 src/package-lock.json 等——不是打进包里,而是链到仓库根目录。

在宿主 .npmrc 中设置 install-links=true,npm 会先 npm pack 再解压安装,node_modules 内只保留与发布一致的内容(需先在插件目录执行 npm run build 保证存在 dist/)。

Vite

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { createCodeInspectorPluginReact } from 'code-inspect-plugin-react';

export default defineConfig({
	plugins: [createCodeInspectorPluginReact({ bundler: 'vt' }), react()],
});

Webpack

const { CodeInspectorPluginReact } = require('code-inspect-plugin-react');

module.exports = {
	plugins: [new CodeInspectorPluginReact()],
};

或使用工厂(等价):

const { createCodeInspectorPluginReact } = require('code-inspect-plugin-react');

module.exports = {
	plugins: [createCodeInspectorPluginReact({ bundler: 'wp' })],
};

(本包为 type: module,若配置仍为 CJS,请使用 createRequire 或改为 import()。)