Skip to content

someok/webpack-build-info-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-build-info-plugin

webpack 打包后生成相关的 build-info.json

Install

# npm
npm i @someok/webpack-build-info-plugin -D

#yarn
yarn add @someok/webpack-build-info-plugin -D

Usage

const WebpackBuildInfoPlugin = require('@someok/webpack-build-info-plugin');

// webpack plugin
plugins = [new WebpackBuildInfoPlugin()];

Options

new WebpackBuildInfoPlugin(options);

options 为对象,支持属性有:

Option 类型 默认值 说明
outputFilename string build-info.json 输出文件名
outputGitInfo boolean true 是否输出 git commit hash,默认为 true
outputOsInfo boolean true 是否输出系统相关信息,默认为 true
extraBuildProperties object {} 附加的额外属性

Example

生成的 build-info.json 示例:

{
    "hash": "ba40d5cc6739654e271b",
    "startTime": 1631101585078,
    "endTime": 1631101655628,
    "osInfo": {
        "arch": "x64",
        "platform": "darwin",
        "release": "20.4.0",
        "type": "Darwin",
        "username": "abc"
    },
    "commitHash": "7cfb3d4fd954134b8576d1a4f7decb84da6901aa"
}

About

webpack 打包后生成相关的 build-info.json

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published