grunt-cache-bust icon indicating copy to clipboard operation
grunt-cache-bust copied to clipboard

fix: gracefully use default for assets

Open wesleycho opened this issue 10 years ago • 3 comments

  • If the assets key is not set in the options object (i.e. the files array has all of the listed assets desired), set to default to an empty array

This gracefully handles the situation where one is not using options.assets - Grunt expects it to be an array of strings, so it being undefined causes Grunt to error.

wesleycho avatar Apr 15 '16 17:04 wesleycho

Hi @wesleycho. What's the use case for this? When would this task be run without the need to provide assets to be busted?

benhoIIand avatar Apr 18 '16 09:04 benhoIIand

@hollandben my company specified the assets with the files array - upon upgrading grunt to 1.0, we ran into this regression in this library where it would fail without the options asset key being an array.

wesleycho avatar Apr 18 '16 12:04 wesleycho

The assets option is a hard requirement for the plugin to work (from v1 onwards). It's worth having a read through the documentation and #147 first to make sure you've got the correct configuration

benhoIIand avatar Apr 19 '16 08:04 benhoIIand