Skip to content

Commit

Permalink
feat: 更新0.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
zerofree00 committed Jun 8, 2023
1 parent 3cc499b commit 0261d62
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ https://www.npmjs.com/package/filemanager-vue2-dist-zip
## vue2.x项目打包的时候,直接压缩dist生成zip
> zipPlugin 可传入自定义的包名 与outputDir 保持一致,
>
> 如: zipPlugin('dist2')
> 传入2个参数 { sourcePath, desPath }
>
> sourcePath:目标包的名字,及,默认dist
>
> desPath:压缩出来的包的名字,及,默认 packageData.name + packageData.version
>
> 如: zipPlugin({ sourcePath : 'dist2' , desPath : 'xx项目' })
>
> 默认dist文件名
Expand All @@ -30,7 +36,7 @@ time // 返回打出来的zip的包的时间
`
configureWebpack: {
devtool,
plugins: process.env.NODE_ENV === 'production' ? [zipPlugin('cppcc-data-exchange-shanxi')] : []
plugins: process.env.NODE_ENV === 'production' ? [zipPlugin({ desPath : 'xx项目' })] : []
}
`

Expand Down
Binary file modified md/img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "filemanager-vue2-dist-zip",
"version": "0.2.4",
"version": "0.2.5",
"description": "使用filemanager-webpack-plugin2.0.5版本vue2打包dist包之后生成zip压缩包",
"author": "[email protected] <[email protected]>",
"main": "lib/index.js",
Expand Down
10 changes: 3 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,12 @@ const extract = function(date) {
}

const time = `${extract(new Date())}`
console.log('zip time==========', time)

const plugin = function(sourcePath) {
// const packageName = `${ packageData.name }-v${ packageData.version }`
const packageName = `${packageData.name}@${packageData.version}`
// console.log('packageName==========', packageName)
// let outputDirName = name || `dist/${ packageName }`
const plugin = function({ sourcePath, desPath }) {
const packageName = desPath || `${packageData.name}@${packageData.version}`
const outputDirName = sourcePath || 'dist'
// let destinationPath = `${ outputDirName }/${ packageName }`

console.log('zip time==========', time)
console.log('开始压缩==========', outputDirName, packageName)
return new FileManagerPlugin({
// events: {
Expand Down

0 comments on commit 0261d62

Please sign in to comment.