Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relivative path problem + busted css lost #207

Open
richardhinkamp opened this issue Nov 2, 2016 · 3 comments
Open

Relivative path problem + busted css lost #207

richardhinkamp opened this issue Nov 2, 2016 · 3 comments

Comments

@richardhinkamp
Copy link
Contributor

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 to
background-image: url(../../assets/images/testbg.1cad98e937926582.png);
but
background-image: url(../images/testbg.png);
is left untouched. Shouldn't it figure out that this relative path does match 'assets/**' because public/assets/css/../images/ == public/assets/images/?

Problem 2: busted css is lost

After running, the file public/assets/css/application.css references the busted testbg.1cad98e937926582.png. But since this CSS file is referenced in index.html, is also gets a hashed copy public/assets/css/application.2464b055e944df27.css and this file references the normal testbg.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?

@akoutmos
Copy link

akoutmos commented Nov 4, 2016

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.

@richardhinkamp
Copy link
Contributor Author

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.

@richardhinkamp
Copy link
Contributor Author

I added the unit test and fix yesterday btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants