Open richardhinkamp opened 8 years ago
Running across this same issue. Particularly when paired with grunt-spritesmith. Worked around the relative path issue by using imgPath in spritesmith, but now the md5s are incorrect.
Problem 2 is because I provided a real filename instead of a wildcard as source. This file replaced with a hashed file so later the filename in de source config does not exist anymore and isn't processed. Will create new unit tests + fix in my pull request.
I added the unit test and fix yesterday btw.
I'm trying to use this for a site and I'm running into 2 problems. See my test project: cache-buster.tar.gz Run
run.sh
to run grunt. This copies/src/
to/public/
, this would be other grunt tasks for combining, preprocessing etc in a real project.Problem 1: relative paths not correctly recognized
After running cache-bust, the CSS file is processed.
background-image: url(../../assets/images/testbg.png);
is changed tobackground-image: url(../../assets/images/testbg.1cad98e937926582.png);
butbackground-image: url(../images/testbg.png);
is left untouched. Shouldn't it figure out that this relative path does match'assets/**'
becausepublic/assets/css/../images/
==public/assets/images/
?Problem 2: busted css is lost
After running, the file
public/assets/css/application.css
references the bustedtestbg.1cad98e937926582.png
. But since this CSS file is referenced inindex.html
, is also gets a hashed copypublic/assets/css/application.2464b055e944df27.css
and this file references the normaltestbg.png
instead of the busted file. So this doesn't work together. Is this a bug, or should use some other kind of config to get this to work?