-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zipped files decompress much larger than the original files #25
Comments
...as a work-around I have replaced //.pipe(zip(taskName + '.zip'))
.pipe(shell('zip dist/' + taskName + '.zip <%= file.relative %>')) |
i'm looking into this issue. so far i've found that the file appears to be 54MB, not 104MB. I'm not sure this matters. Using yazl alone, I am not able to reproduce your issue:
I'm trying to test the usecase with gulp-zip, but I must admit I'm an outsider to the gulp club. After about 10 minutes, this is my best attempt at reproducing your issue: in gulpfile.js: const gulp = require('gulp');
const zip = require('gulp-zip');
gulp.task('default', () => {
return gulp.src("../labmda-lib.zip")
.pipe(zip('gulp.zip'))
.pipe(gulp.dest('dist'));
}); the from the command line:
If you can help me get a reproducible test case, it would help me resolve this issue. (I will be unavailable for the next few hours, however.) Otherwise, I will look into a gulp tutorial or something to try to learn what the above example is missing. |
You need to $ unzip lambda-lib.zip
$ ls -alsh libociei.so const gulp = require('gulp');
const zip = require('gulp-zip');
gulp.task('default', () => {
return gulp.src('libociei.so')
.pipe(zip('gulp.zip'))
.pipe(gulp.dest('dist'));
}); $ mv libociei.so libociei.so.original
$ gulp
$ unzip dist/gulp.zip
$ ls -alsh libociei.so* |
when i follow your steps, i get the correct output. can you tell me what versions of everything you're using? here's what i've got: |
Node.js version might be worth noting too. |
|
Ah - I'm afraid I'm going to have to cop the blame for this one. I've actually got an extra line in my gulpfile: gulp.task('default', () => {
return gulp.src('libociei.so')
.pipe(require('gulp-replace')(/\$\{email.password\}/g, process.env.EMAIL_PASSWORD))
.pipe(zip('gulp.zip'))
.pipe(gulp.dest('dist'));
}); ...When I comment out the |
For completeness: gulp-replace has a "skipBinary" option that defaults to false. Set that to true to avoid trying replacement in binary files such as images. |
There is a 105MB file within the
lambda-lib.zip
archive at node-oracledb-for-lambda. When I usegulp-zip
(which usesyazl
) to add it to a new zip archive, and then unzip that archive the 105MB file has grown to 140MB.Also, when submitting a yazl-generated zip containing binary libraries to AWS Lambda, an error is thrown:
(this was the cause of oracle/node-oracledb#468)
The text was updated successfully, but these errors were encountered: