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 absolutely LOVE this grunt plugin, but am really having a hard time using the cloudfront task. It appears from the documentation that the 'invalidations' array needs to have static full paths to files passed in (i.e. '/index.html', '/assets/css/main.css', etc.). However, as I'm sure you can deduce, keeping a list of every file in the project (esp. as the project grows over time) with each file being it's own line-item/string is exhaustive. I was hoping that instead, I could use some of Grunt's built-in globbing functions so that I am able to scan the entire folder tree for specific file types and invalidate those files.
Here's what I'm trying below in my Gruntfile. If anyone has any ideas, please let me know! This causes the Grunt build to fail. Not sure why I cannot use Grunt's globbing patterns. :(
cloudfront: {
options: {
accessKeyId: '###masked for security###', // confirmed this is working
secretAccessKey: '###masked for security###', // confirmed this is working
distributionId: '###masked for security###', // confirmed this is working
invalidations: [
// Fonts
'/assets/fonts/**/*.{eot,svg,ttf,woff,woff2}',
// Text
'/**/*.{txt,xml,pdf}',
// Images
'/assets/images/**/*.{jpg,webp,png,gif}',
'/projects/images/**/*.{jpg,webp,png,gif}',
// JS
'/assets/js/**/*.{js,map}',
// CSS
'/assets/css/**/*.{css,map}',
// HTML
'/**/*.html'
]
}
}
The text was updated successfully, but these errors were encountered:
Yeah I would love to be able to tell which assets were synced with the s3 task and invalidate those items. Or at the very least use the file list from the s3 sync as the invalidation list.
Any updates here anyone, or have either of you @jpillora / @treasonx figured out a viable solution that you're using until this type of globbing pattern support is added?
I absolutely LOVE this grunt plugin, but am really having a hard time using the cloudfront task. It appears from the documentation that the 'invalidations' array needs to have static full paths to files passed in (i.e. '/index.html', '/assets/css/main.css', etc.). However, as I'm sure you can deduce, keeping a list of every file in the project (esp. as the project grows over time) with each file being it's own line-item/string is exhaustive. I was hoping that instead, I could use some of Grunt's built-in globbing functions so that I am able to scan the entire folder tree for specific file types and invalidate those files.
Here's what I'm trying below in my Gruntfile. If anyone has any ideas, please let me know! This causes the Grunt build to fail. Not sure why I cannot use Grunt's globbing patterns. :(
The text was updated successfully, but these errors were encountered: