我如何在grunt中压缩文件夹? [英] How can I zip a folder in grunt?
本文介绍了我如何在grunt中压缩文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个文件夹foo
,但是在我的目标文件夹target
我想发送邮编版本的我的foo
文件夹,如foo.zip
,我google找到了很多压缩文件的方法但不是为文件夹,所以我们如何可以在grunt中压缩整个文件夹?
I have a folder "foo"
, but in my target folder "target"
I want to send zip version of my "foo"
folder such as "foo.zip"
, I google and found many way for zipping files but not for folder, so how can we zip a whole folder in grunt ?
推荐答案
接受的答案是在grunt中抛出一个错误-contrib-compress 0.5.0。试试这个:
The accepted answer was throwing an error in grunt-contrib-compress 0.5.0. Try this instead:
compress: {
foo: {
options: {
archive: './foo.zip',
mode: 'zip'
},
files: [
{ src: './foo/**' }
]
}
}
这篇关于我如何在grunt中压缩文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文