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

@aurouscia/signalr-comment-fixer

v1.0.0

Published

一个 Vite 插件,用于消除构建 `@microsoft/signalr` 时出现的 `/*#__PURE__*/` 注释警告。

Readme

signalr-comment-fixer

一个 Vite 插件,用于消除构建 @microsoft/signalr 时出现的 /*#__PURE__*/ 注释警告。

安装

npm install @aurouscia/signalr-comment-fixer --save-dev
pnpm add -D @aurouscia/signalr-comment-fixer

问题背景

使用 Vite/Rollup 构建依赖 @microsoft/signalr 的项目时,可能会遇到如下警告:

A comment "/*#__PURE__*/" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.

该警告不会影响构建结果,但会在每次构建时刷屏。其原因是 @microsoft/signalr 的部分代码把 /*#__PURE__*/ 注释放在了函数声明之前,而 Rollup 无法识别这种位置的注解。

本插件会在 transform 阶段自动处理 @microsoft/signalr 模块,移除函数声明前的 /*#__PURE__*/ 注释,从而避免警告。

使用

vite.config.ts 中引入并注册插件:

import { defineConfig } from 'vite'
import { signalrCommentFixerPlugin } from '@aurouscia/signalr-comment-fixer'

export default defineConfig({
  plugins: [
    signalrCommentFixerPlugin()
  ]
})

API 参考

signalrCommentFixerPlugin()

返回一个 Vite 插件对象。

function signalrCommentFixerPlugin(): Plugin

| 属性 | 值 | 说明 | |------|-----|------| | name | 'signalr-comment-fixer' | 插件名称 | | enforce | 'pre' | 确保插件尽早执行 |

实现细节

  • 插件通过 transform 钩子处理模块代码。
  • 仅对路径中包含 @microsoft/signalr 的模块生效。
  • 使用正则表达式移除函数声明前的 /*#__PURE__*/ 注释,不影响其他代码或注释。

注意事项

  • 本插件仅用于消除构建警告,不会修改 @microsoft/signalr 的运行时行为。
  • 如果 @microsoft/signalr 在后续版本中修复了该注释位置问题,可以移除本插件。