gpt4 book ai didi

javascript - 没有根文件夹的 Grunt Compress

转载 作者:行者123 更新时间:2023-11-29 10:15:39 30 4
gpt4 key购买 nike

我正在尝试使用 grunt 压缩目录。我在我的 grunt 文件中尝试了以下部分。

compress: {
main: {
options: {
archive: 'dist/output.zip',
mode: 'zip'
},
files: [{
src: ['build/*'],
cwd: 'build',
expand: true
}]
}
}

这给了我一个空的 zip 文件。或者

    compress: {
main: {
options: {
archive: 'dist/output.zip',
mode: 'zip'
},
files: [{
src: ['build/*']
}]
}
}

它在我的 zip 文件中提供了以下结构

output.zip
- build
- my files

但我想删除构建目录以获取

output.zip
- my files

我可以做哪些改变来获得这个结构?

最佳答案

你试过吗:

compress: {
main: {
options: {
archive: 'dist/output.zip',
mode: 'zip'
},
files: [{
src: ['**/*'],
cwd: 'build/',
expand: true
}]
}
}

关于javascript - 没有根文件夹的 Grunt Compress,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22569858/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com