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

@barretter/last-release-git-info-plugin

v1.2.0

Published

webpack plugin for create git info when build

Downloads

8

Readme

last-release-git-info-plugin

Table of Contents

Features

在构建的时候可以根据配置在浏览器控制台,以及构建终端的时候输出最新一次的构建信息(包括构建时间、构建分支、构建commitID、最近开发者名称、最近开发者邮箱、最新commit日期、最新commit信息)。注意:由于这些信息属于敏感信息,在生产环境不能在控制台输出这些构建信息!!生成的txt文件可以通过反爬虫防止爬虫爬取。

生成的信息如下:

*********************************************************************
构建日期: 2021-7-6 15:14
构建分支: main
构建commit:6539e75f3cf5686eda6892bce5986ae4674cf227
commit时间:2021-7-3 16:03
说明:feat: 🎸 添加access
*********************************************************************

⬆ Back to Top

Install

yarn add @barretter/last-release-git-info-plugin -D

⬆ Back to Top

Usage

该插件依赖git项目,需要结合git项目使用

在webpack项目中使用

const LastReleaseGitInfoPlugin = require('@barretter/last-release-git-info-plugin')

const config = {
  plugins: [
    new lastReleaseGitInfoPlugin(options)
  ]
}

在vue-cli中使用

vue.config.js

const LastReleaseGitInfoPlugin = require('@barretter/last-release-git-info-plugin')
const config = {
  chainWebpack: config => {
    config.plugin('last-release-git-info-plugin').use(LastReleaseGitInfoPlugin, [options])
  }
}

在nuxt.js中使用

nuxt.config.js

const config = {
  modules: ['@barretter/last-release-git-info-plugin/nuxt', options]
}

就这么简单!

⬆ Back to Top

Options

options.buildLog

  • Type: boolean
  • Default: false

是否在构建的时候输出最新一次的构建信息。

options.log

  • Type: boolean
  • Default: false

是否在浏览器控制台输出最新一次的构建信息。

options.generateFile

  • Type: boolean
  • Default: false

是否生成构建信息文件。

options.releaseFileName

  • Type: string
  • Default: release_git_info.txt

最新构建信息的保存文件名。

options.showBuildTime

  • Type: boolean
  • Default: true

是否显示构建时间

options.showBuildBranch

  • Type: boolean
  • Default: true

是否显示构建分支

options.showBuildCommitId

  • Type: boolean
  • Default: true

是否显示构建commitID

options.showDeveloperName

  • Type: boolean
  • Default: false

是否显示开发者名称

options.showDeveloperEmail

  • Type: boolean
  • Default: false

是否显示开发者邮箱

options.showBuildCommitDate

  • Type: boolean
  • Default: true

是否显示commit日期

options.showBuildCommitInfo

  • Type: boolean
  • Default: true

是否显示commit信息

options.externalTxt

  • Type: string
  • Default: ''

额外显示的字段

Notice

目前该插件暂时不支持webpack5

License

MIT

⬆ Back to Top