-
Notifications
You must be signed in to change notification settings - Fork 84
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
Question: Is it possible to upload both gzipped and non-gzipped files? #65
Comments
You should be able to create two streams merge them and then sync Sent from my iPhone
|
Ah, thanks for the tip, this is what I ended up doing: var gulp = require("gulp");
var awspublish = require('gulp-awspublish');
var rename = require("gulp-rename");
var merge = require('merge-stream');
var publisher = awspublish.create({
params: {
Bucket: 'test-bucket'
}
});
function prefixFile(path) {
path.dirname = '/foo/' + path.dirname;
}
gulp.task('s3', function() {
var gzipFilter = [
'public/**/*.js', 'public/**/*.html',
'public/**/*.css', 'public/**/*.xml',
'public/**/*.txt', 'public/**/*.ico',
'public/**/*.json',
];
var negativeFilter = gzipFilter.map(function(x) {
return '!' + x;
});
var gzip = gulp.src(gzipFilter)
.pipe(rename(prefixFile))
.pipe(awspublish.gzip());
var plain = gulp.src(['public/**/*'].concat(negativeFilter))
.pipe(rename(prefixFile));
return merge(gzip, plain)
.pipe(publisher.cache())
.pipe(publisher.publish())
.pipe(publisher.sync())
.pipe(awspublish.reporter());
}); Think something like this is worth adding to the examples? I can create a PR when I get a chance. |
yep but maybe just specify the part not specific to your app so just keep
On Thu, Jun 4, 2015 at 11:52 AM, James F McMahon notifications@github.com
PG |
It is possible to upload both gzipped and non-gzipped files in a single task?
Currently I have the following:
But if I try to add
sync
to either or these tasks they delete each other's files. Is it possible to do this is in single task so thatsync
respects that both versions of the file should be uploaded?The text was updated successfully, but these errors were encountered: