How can I zip a folder in grunt?

风格不统一 提交于 2019-12-03 12:33:54

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/**' }
        ]
    }
}

From above suggestion I am able to get my answer,We can use https://github.com/gruntjs/grunt-contrib-compress/ for zipping a folder.

compress: {
            zip:{ 
                  files: {
                            './foo.zip': './foo/**'
                         }
                }
          }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!