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

@qqi/rollup-external

v1.1.2

Published

用于 rollup 打包 📦 时排除异己的工具 🔧

Readme

qqi rollup-external

一个简单的 rollup 构建打包时的排除外部依赖的函数(多用于构建 npm 库包)

因为我在构建新的 npm 库包时,常因不仔细导致包

安装

npm install  --save-dev @qqi/rollup-external

使用

rollup.config.js 文件中配置:

.... 其他引用
import { external } from '@qqi/rollup-external';
.... 其他代码逻辑

export default {
  ... 其他配置,
  external: external({
    // 默认排除 package.json 中 dependencies 的依赖
    // 排除 `node:`、`a-`、`color-pen` 、`@qqi`开头的依赖
    exclude: ["node:", "a-" ,"color-pen", "@qqi/"],
    // 忽略 `node:` 开头的包在 package.json 中未声明的 dependencies 的依赖
    // 未配置改项,若项目中包含 `node:`
    ignore: ["node:"],
    // 一定要包含的依赖,将被打包入打包文件夹内
    //  或是使用 `src/` 等路径,则报错 “依赖未被排除,打包关闭”
    include: ['@qqi/copy-text','src/utils', 'src/dog']
  }),
  ... 其他配置,

}
  • 默认读取 package.json 中的 dependenciespeerDependencies 的依赖项作为 exclude 的值,即改值一般无需配置
  • include 使用的全量对比,且优先级要远远高于 excludeignore 的配置,若在 dependencies 中配置了某依赖却又想将该依赖包含在打包文件内时可使用 include(但是需注意包会包含于 'node_modules' 文件夹下,保证 files 字段包含该项)
  • ignore 用于忽略那些不包含于 'package.json' 的 dependencies 中却需要被排除的依赖,如 node:src/ 等路径的依赖。校验时以输入的字符串的 startWith 判断
  • 可直接不使用参数,如果仅是想排除 'package.json' 文件中 dependencies 配置依赖 (怎么感觉有一股翻译腔)

第二参数

第二参数可控制在使用时在控制台展示简易日志。

第二参数可接受的类型

  • boolean : 为 true 将为每一个引入打印简易日志
  • string : 将使用 id.includes(str) 的方式判定是否打印该条简易日志
  • string[] :将为数组中的每一项使用 id.includes(str) 判定

文档地址

@qqi/rollup-external