You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I originally misread the title as being able to push your built files to a CDN. For those looking to do that, here is an easy way to do it with gulp-cloudfront and gulp-awspublish.
var gulp = require('gulp');
var cloudfront = require('gulp-cloudfront');
var awspublish = require('gulp-awspublish');
// AWS config object
var aws = {
'params': {
'Bucket': 'bucketname' // s3 bucket
},
'accessKeyId': 'yourAccessKeyId',
'secretAccessKey': 'yourSecretAccessKey',
'distributionId': 'yourCloudFrontDistributionId'
};
var publisher = awspublish.create(aws);
var headers = {'Cache-Control': 'max-age=315360000, no-transform, public'};
/**
* ITS CDN TIME
*/
gulp.task('cdn', function () {
gulp.src('public/distribution/**')
.pipe(awspublish.gzip())
.pipe(publisher.publish(headers))
.pipe(publisher.cache())
.pipe(awspublish.reporter())
.pipe(cloudfront(aws));
});
Since this issue was written we added support for the bundle.result pathPrefex option. If that doesn't support your use case, we have a different issue open for a pathPrefix per bundle: #60
detect cdn urls and, if present, don't bundle anything but instead add it to the
bundle.results.json
as a scripts/style include from the given urlThe text was updated successfully, but these errors were encountered: