benhoIIand / grunt-cache-bust

Cache bust static assets using content hashing
MIT License
265 stars 103 forks source link

Assets with paths not updated in 1.5.0 #218

Open jsiragusa opened 7 years ago

jsiragusa commented 7 years ago

I was previously using v1.4.1 and when I had an HTML like: <script type="text/javascript" src="assets/app.js"></script>

It would correctly get busted to: <script type="text/javascript" src="assets/app.HASH.js"></script>

I bumped up to 1.5.0 and noticed that the HTML is not updated (output from the task doesn't indicate any errors). However, I noticed if the assets are referenced without a path, they are updated correctly. I.e. <script type="text/javascript" src="app.js"></script> works.

Is this by design? I couldn't find anything in the docs to suggest that assets with a path shouldn't work by default.

enstyled commented 7 years ago

Having the same issue.

bastienmoulia commented 7 years ago

Probably a file system issue. @jsiragusa @enstyled are you on Windows?

jsiragusa commented 7 years ago

OS X for me

enstyled commented 7 years ago

OS X 10.12.2 here.

colleen-love commented 7 years ago

Debian 8.7 on Docker here.

carlotrimarchi commented 7 years ago

I have the same issue on a Mac

richardhinkamp commented 7 years ago

Could anybody test with the fixes in PR #220? If that doesn't fix your setup, could you provide a test cases/config so I can look at it?

jsiragusa commented 7 years ago

@richardhinkamp apologies for the delay. It was some time until I could get back on this project. I tested your PR and, unfortunately it didn't help my issue. However, I began to examine the changes in your PR and well as the commit (0c69b179be045a0031f2d9da8260b0d99510ffa2) that I believe introduced the problem and I discovered that it's how the assets are treated.

My original config (which worked fine in v.1.4.1):

        options: {
          baseDir: '<%= build_dir %>/assets/',
          assets: ['*.js', '*.css']
        }

Adjusted config which now works with v1.5.0

        options: {
          baseDir: '<%= build_dir %>/',
          assets: ['assets/**.js', 'assets/**.css']
        }