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 🙏

© 2024 – Pkg Stats / Ryan Hefner

pd-build-env-info

v2.0.2

Published

向构建产物中加入环境构建信息(目前仅支持webpack生态,vite支持正在开发中。。。)

Downloads

4

Readme

向构建产物中加入环境构建信息

由于在工作中发现某些情况下无法区分是否发版成功,或者无法区分是否最新的代码已经在某个地方生效,所以想着向构建产物加入一些本次构建的环境信息来区分是否已经生效我们的修改~

安装配置

# 强烈推荐使用蚂蚁大佬的ni,无视包管理器差异
npm i @antfu/ni -g
# 安装
ni pd-build-env-info -D
const BuildInfoPlugin = require('pd-build-env-info')
// vue-cli中,如果是纯原生webpack,放到插件列表即可
config.plugins.push(
  new BuildInfoPlugin({
    // 是否显示git信息
    git: true,
    // 是否显示环境构建信息
    buildEnv: true
  })
)

然后就和平时开发和生产构建没有任何区别了~

成功标志

构建成功后在控制台使用$EBI(ENV-BUILD-INFO的简写,方便记忆)来检测是否成功混入构建信息

Q:为什么需要在控制台操作再显示? A:为了信息隐蔽性

$EBI
// 如果没有报错,你将看以下类似信息

// 提交主题  xxx 
// 提交分支  xxx 
// 提交哈希  xxx 
// 提交日期  2023-10-19 16:27:48 +0800 
// 提交人  xxx 
// 提交邮箱  xxx 
// 当前node版本  v16.20.2 
// 上次构建时间  2023/10/20 16:51:00 

关于vite的支持

正在进一步开发中~