-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
|
@@ -19,7 +20,6 @@ | |
"表单设计器", | ||
"表格设计器" | ||
], | ||
"author": "BoBo<[email protected]>", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/BoBoooooo/Element-Pro-Crud" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
|
@@ -44,7 +47,6 @@ module.exports = { | |
}, | ||
configureWebpack: (config) => { | ||
const plugins = [ | ||
new webpack.BannerPlugin('@author BoBo<[email protected]>'), | ||
new TerserPlugin({ | ||
terserOptions: { | ||
compress: { | ||
|
@@ -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]; | ||
|