Author Webpack Plugin
给html打上带有author的meta 标签
安装
npm install author-webpack-plugin
在webpack的配置文件中,引入
const AuthorWebpackPlugin = require('author-webpack-plugin')
在插件中使用
plugins : [
...
new AuthorWebpackPlugin()
]
为了更好统一页面的作者信息,author plugin对作者信息进行了强约束
,使用该插件配合需添加作者的信息,添加作者信息的方式有:
- 在项目
package.json
里添加author的选项 - 在webpack配置里传入option: {author: 'xxx'}
如果从以上都没有获得,那么会从
git log
与git remote
相关信息中猜测 author 与 group,猜测仍没有结果时将会直接报错
- init
- 增加强校验author
- 修改插入meta的位置
- 增加从commit自动获取author
- 增加从repository获得group名称,没有时从git remote中获取