Skip to content

Commit

Permalink
ci: update banner info
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Feb 1, 2021
1 parent ea7562c commit c7d1c48
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "element-pro-crud",
"version": "0.8.6-1",
"author": "BoBo<[email protected]>",
"main": "lib/ProCrud.umd.min.js",
"files": [
"lib",
Expand All @@ -19,7 +20,6 @@
"表单设计器",
"表格设计器"
],
"author": "BoBo<[email protected]>",
"repository": {
"type": "git",
"url": "https://github.com/BoBoooooo/Element-Pro-Crud"
Expand Down
15 changes: 14 additions & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
const {
name, version, author, homepage,
} = require('./package');

function resolve(dir) {
return path.join(__dirname, dir);
Expand Down Expand Up @@ -44,7 +47,6 @@ module.exports = {
},
configureWebpack: (config) => {
const plugins = [
new webpack.BannerPlugin('@author BoBo<[email protected]>'),
new TerserPlugin({
terserOptions: {
compress: {
Expand All @@ -56,6 +58,17 @@ module.exports = {
sourceMap: false,
parallel: true,
}),
// 注意位置,必须放在 TerserPlugin 后面,否则生成的注释描述会被 TerserPlugin 或其它压缩插件清掉
new webpack.BannerPlugin({
entryOnly: true, // 是否仅在入口包中输出 banner 信息
banner: () => `${name} v${version}`
+ '\n'
+ `Author: ${author}`
+ '\n'
+ `Documentation: ${homepage}`
+ '\n'
+ `Date: ${new Date()}`,
}),
];
if (process.env.NODE_ENV !== 'development') {
config.plugins = [...config.plugins, ...plugins];
Expand Down

0 comments on commit c7d1c48

Please sign in to comment.