1.1.0 • Published 8 months ago

mark-gitinfo-plugin v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

使用方法

  1. npm i mark-gitinfo-plugin or yarn add mark-gitinfo-plugin
  2. 在 webpackConfig 中引用 const MarkGitinfoPlugin = require('mark-gitinfo-plugin')
  3. 在 webpackConfig 的plugins 中插入 new MarkGitinfoPlugin()
  • 例如:在CRA项目中的 config-overrides.js 文件中
const MarkGitinfoPlugin = require('mark-gitinfo-plugin')

module.exports = function override(config){
    if(config.mode === 'production'){
        setPlugins()
    }
    return config

    function setPlugins(){
        config.plugins.push(new MarkGitinfoPlugin())
    }
}

效果

在build中生成verson.txt文件,生成如下信息

  Project Name: app-base
  Project Remote: app-base
  Project Branch: master
  Commit Hash: 7413fa2
  Commit Date: 2023-05-22 22:34:49
  Build Date: 2023-05-22 22:56:59
1.1.0

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.2

12 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.1

1 year ago

1.0.0

1 year ago