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 🙏

© 2025 – Pkg Stats / Ryan Hefner

umi-plugin-bundle-compress

v0.1.21

Published

[![NPM version](https://img.shields.io/npm/v/umi-plugin-bundle-compress.svg?style=flat)](https://www.npmjs.com/package/umi-plugin-bundle-compress) [![NPM downloads](http://img.shields.io/npm/dm/umi-plugin-bundle-compress.svg?style=flat)](https://www.npmjs

Downloads

1

Readme

umi-plugin-bundle-compress

NPM version NPM downloads

compress project bundle

Install

# or yarn add -D umi-plugin-bundle-compress
$ npm install umi-plugin-bundle-compress --save --dev

这个 umi 插件目的是为了帮助开发者缩小项目打包体积,下面是缩小项目包体积的具体内容:

  • moment 替换成 dayjs, 实现体积压缩
  • lodash 体积压缩
  • @antv/l7-react 体积压缩
  • 自动生成 icon.js(此文件里包含项目中自行引入/antd 使用的所有 icon), 并修改
  • 提供 externals 配置项,用来在 html 文档中添加外部 scripts, 以及使用 externals

Usage

Configure in .umirc.js And config/config.js,

.umirc.js

export default {
  plugins: [
    [
      "umi-plugin-bundle-compress",
      {
        externals: [
          // 用来自动配置外部 scripts, 同时暴露externals
          {
            // 挂载到`window`上的变量名称
            name: "React",
            // 对应的npm包名称
            pkgName: "react",
            //  加载外部script的url
            url:
              "https://gw.alipayobjects.com/os/lib/react/16.13.1/umd/react.development.js",
          },
        ],
        l7: false, // 是否需要压缩@antv/l7-react,默认为false, 不开启
        lodash: true, // 是否需要压缩lodash,默认为true
        moment: true, // 是否需要压缩moment(替换为dayjs),默认为true
        antdIcon: true, // 是否需要替换替换 antd3 对于 icon 的引用,默认为true
      },
    ],
  ],
};

如果遇到问题或者需要支持新的功能, 欢迎向我们提出 issue, 以及需要支持的新特性; 欢迎 PR

Issues

Pull Requests

LICENSE

MIT