cachinggruntjsgrunt-usemin

grunt-cache-breaker not renaming revved files


I'm using grunt-cache-breaker to add a md5 hash to my filename. When I run grunt, it runs like normal, no error messages. While the filename inside the markup has the added md5 hash, the actual file does not have the md5 hash.

Here's what the cache breaker task looks like in my Gruntfile.js

                  cachebreaker: {
                  dev: {
                      options: {
                          match: ['idm-ui-vendor.min.js'],
                          replacement: 'md5',
                          src: {
                              path: 'tmp/dev/common/scripts/idm-ui-vendor.min.js'
                          }
                      },
                      files: {
                          src: ['tmp/dev/login/views/view.jsp']
                      }
                  }
              }

Solution

  • The grunt-cache-breaker library (version <= 2.0.1) does not support file renaming. It only updates references to files.

    I'd suggest you use the grunt-cache-bust library instead.