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

@vitue/export-build-info

v1.1.0

Published

Automatically export the relevant information of the project after the build, such as git branch, build time, etc.

Downloads

10

Readme

vite-plugin-export-build-info

🛵 Automatically export the relevant information of the project after the build, such as git branch, build time, etc.

npm version Test

动机

  1. 如果项目会被部署到多个的客户环境,而你可能不知道;
  2. 如果项目开发的周期不稳定,例如此次发布距离上一次超过一年;
  3. 如果项目分支非常多,并且年份老远;
  4. 如果项目人员频繁更换。。。

以上,该插件处理上述问题的方式是:

在打包出静态资源的同时,导出一些关键信息到特定文件,方便后续的开发确认。

其中,会包含项目的 Git 信息,主要通过git-repo-info实现,会打印git-repo-info返回的所有信息。同时还包括项目构建的时间,当前用户(所在设备)的 Git usernameemail信息,并且支持扩展。

安装

需要 [email protected]+ 版本。

yarn add @vitue/export-build-info -D

# npm
npm install --save-dev @vitue/export-build-info

使用

// vite.config.ts/.js
import { ExportBuildInfo } from '@vitue/export-build-info'

export default defineConfig({
  plugins: [
    vue(),

    // 该插件只会在 build 阶段的最后执行
    ExportBuildInfo({
      fileName: 'build-info',
      extend: {
        oha: 'oha'
      }
    })
  ],
})

参数说明:

  • fileName:非必需,默认为 build-info,文件输出位置会跟 Vite 的 build.outDir 保持一致;
  • extend:非必需,扩展属性;若字段冲突,会被覆盖,并且扩展字段会排在最前面。

导出的文件没后缀名。

License

MIT.