1.0.3 • Published 1 year ago
project-meta-plugin v1.0.3
project-meta-plugin
安装
npm i project-meta-plugin --save-dev
配置
const distPath = path.resolve(__dirname, 'dist');
const meta_plugin = new ProjectMetaPlugin({
outputPath: distPath,
fileName: 'meta.json',
some_variable: {url: 'http://localhost:8080'},
tag: true,
author: true,
commitDate: true,
commitMessage: true
})
module.exports = {
plugins: [
meta_plugin,
],
}
生成文件示例
{
"GIT_TAG_VERSION": "v1.0.0",
"GIT_LATEST_AUTHOR": "Mia",
"GIT_LATEST_MESSAGE": "custom plugin & demo",
"GIT_COMMIT_DATE": "2022/04/05 17:54:22",
"url": "http://localhost:8080"
}