Message:
Cannot read property 'Bucket' of undefined
I'm getting this error message on execute.
const
gulp = require( "gulp" ),
awsPublish = require( "gulp-awspublish" ),
cloudfront = require( "gulp-cloudfront" ),
aws = {
key:"",
secret: "",
distributionId: "",
bucket: "",
region:""
},
envFlag = "dev";
gulp.task( "toS3:dev", () => {
const publisher = awsPublish.create( aws );
return gulp.src( "./src/dist/**" )
.pipe( awsPublish.gzip() )
.pipe( publisher.publish( {
"x-amz-acl": "public-read",
"Cache-Control": ( envFlag === "prod" ? "max-age=3600" : "max-age=120" )
}))
.pipe( publisher.cache() )
.pipe( awsPublish.reporter() )
.pipe( cloudfront( aws ) );
});
I'm getting this error message on execute.