-
Notifications
You must be signed in to change notification settings - Fork 85
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
awspublish.gzip sets s3.path making it impossible to change it later #82
Comments
Just got bitten by this pretty hard. +1 to fix please |
Maybe we can add a note in the Readme? |
I found this issue really helpful in my searches, so I wanted to update the temporary solution from above with revised code. The below example uses node's var path = require('path');
var rename = require('gulp-rename');
var NEW_S3_DIRECTORY = 'new/s3/directory-example';
gulp.src('path/to/distribution/directory/**/*')
.pipe(rename(function(filePath) {
filePath.dirname = path.join(NEW_S3_DIRECTORY, filePath.dirname);
}))
.pipe(awspublish.gzip())
.pipe(publisher.publish())
.pipe(publisher.cache())
.pipe(awspublish.reporter()); |
@psullivan6 Thanks! Just make sure you don't do |
@emilymerwin @psullivan6 if you'd like, you should be able to use |
Hello Internet, If you're here because you're using gulp.task('publish', () => {
const publisher = awspublish.create({
region: 'us-east-1',
params: {
Bucket: 'my-bucket',
},
});
return gulp.src('./build/unbundled/**/*')
.pipe(awspublishRouter({
cache: {cacheTime: 315360000, gzip: true},
routes: {
// Cache index and service worker for 5 minutes
"((\bindex\.html\b)|(\bservice-worker\.js\b))": {cacheTime: 600, key: "eve/$&"},
//pass everything else through to `eve`
"^.+$": {key: "eve/$&"}
}
}))
.pipe(publisher.publish())
.pipe(publisher.cache())
.pipe(awspublish.reporter());
}); |
Every plugin that tries to change the file path after
awspublish.gzip
has been run has no effect.Example using gulp-rename:
The workaround is to use
awspublish.gzip
immediately beforepublisher.publish
.The text was updated successfully, but these errors were encountered: