Closed rickychien closed 9 years ago
How can we update it? gulp-zip don't know where you put it with gulp.dest
. Can you provide an example of how it would look like?
I'm not familiar with how gulp works, so I don't really know why gulp-zip cannot know where is the zip =( Are there any way to calculate the final location of zip so that we can pass it into gulp-zip?
Gulp plugins just works on a stream of in-memory file objects. They have no sense of the filesystem. You could potentially pass the same path to gulp-zip
as you pass to gulp.dest
, but I'm not interested in adding such thing to this plugin.
Nope, this wouldn't work. Only thing I can think of is adding a existing
option that would take a path to a existing archive and use that.
+1 for adding a { existing: 'path/to/target.zip' }
option so that gulp-zip could repack existed files.
@sindresorhus, wdyt? It's a pretty weird option but might make sense since zip archives can get pretty heavy.
Unfortunately this is no longer possible since the switch to https://github.com/thejoshwolfe/yazl. On the other hand, yazl should show a lot of speed improvements.
See also JSZip doc: https://stuk.github.io/jszip/documentation/api_jszip/file_data.html
As document mentioned, we should just update zip entry if the zip file does exist rather than recreate a new zip again, so that it could combine with gulp-changed to speed up our incremental build.
Try to open exist zip by
var zip = new JSZip(filePath)
at [1].[1] https://github.com/sindresorhus/gulp-zip/blob/master/index.js#L17