1.0.7 • Published 9 months ago

pack-info-webpack-plugin v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

pack-info-webpack-plugin

用来记录webpack打包时git相关信息

展示信息

  • git 仓库地址
  • git 分支
  • git 提交节点信息
  • 打包时间
  • 打包人员信息

最终生成 buildInfo.json 的文件,位于最终产物的根目录

Usage

npm i pack-info-webpack-plugin -D

// 在webpack config中配置插件

const PackInfoWebpackPlugin = require('pack-info-webpack-plugin')

configureWebpack: {
    ...
    plugins: [
      new PackInfoWebpackPlugin()
    ]
    ...
  }
  
// 或者
configureWebpack: (config) => {
    ...
    _module.plugins = [
      new PackInfoWebpackPlugin()
    ]
    ...
    return _module
  }

options

// 可以配置参数, 排除显示那些字段
new PackInfoWebpackPlugin({
    excludeKeys: ['buildUserEmail'],
    isBase64: true // 是否对结果进行base64编码,避免泄露信息
})

// 全部字段如下:
{
    gitUrl: 'gitUrl', 
    branch: 'branch',
    commitHash: 'commitHash',
    commitAuthor: 'name',
    commitTime: 'date',
    commitMessage: 'message',
    buildTime: '',
    buildUserName: 'buildUserName',
    buildUserEmail: 'buildUserEmail'
}
1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago