Open kaffolder7 opened 9 years ago
I'm guessing globbing patterns support needs to be added, I don't actually use cloud front, @bxjx any ideas?
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?
Invalidation paths can now be dynamic, so you can just do this:
options: {
invalidations: ['/assets/fonts/*']
}
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html
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. :(