-
Notifications
You must be signed in to change notification settings - Fork 61
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
Using gulp-clean-css, font file paths specified in url() setting a wrong path #42
Comments
I saw the same problem with images background-image: url('../images/load.png'); background-image:url(images/load.png) |
same issue here. important to note that i'm using gulp-clean-css w/out ANY parameters, if that helps. no rebase/relativeto/whatever. |
I too have this issue. But i believe I've found the issue. TL;DR: clean-css option update -> Here's why... in clean-css v4.0:
The
this looks like it will get the relative path of the project and rebase it, which is what @angularPublic and I are experiencing. I'm guessing all of us have the same pipe for this:
at the point of setting the
So don't rebase and let the browser handle the relative path. edit: I haven't look at code, this is all just from the README.md...and seems to work for me. |
What @jonyeezs said |
Interesting! Sorry about that everyone. Perhaps I can simply default |
That fixed it for me, you can mark closed. Thanks! |
Hi @scniro thanks for looking into it. That sounds like it'll solve the problem for the peeps in here. Definitely fixes for the uninitiated, but for those who are more familiar with clean-css, may find this an issue. Perhaps make a note about the breaking changes and rebase default (which looks to have been introduce in version 3.0.0 and since now matters due to commit 92ddf63)? thoughts? |
I think the default behavior was just completely broken while in the gulp pipeline. We're specifying files via However, simply because we're in the gulp pipeline the file paths we glob in aren't exact to what they really are. In this case, I think it's okay. After all, if no
gulp => no
This seems desirable in all ways. Before the fix this morning, the resulting rule looked something like
Which, I think will always be the unintentional result. However, should the situation every arise where this is somehow desirable, I can surface |
@scniro . Thanks for looking into this. Introducing rebase as an optional param would be nice. |
Thanks for this, I was having issues almost same as OP, The correct url path I was only having the problem when running the solved it with |
@jonyeezs you saved my life! just added I have been using gulp with clean-css and this is my file structure : before :
after :
After setting |
Hi,
With the recent changes, gulp build that using gulp-clean-css having issues with url() path values.
Example, this below
url('../fonts/glyphicons-halflings-regular.woff2')
is converted to below,
url('scripts/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2')
Where, scripts is my library folder.
in the minified css.
I guess, this related to rebaseTo changes?
The text was updated successfully, but these errors were encountered: