-
Notifications
You must be signed in to change notification settings - Fork 147
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
What happened to relativeTo? #196
Comments
I'm also experiencing a similar issue. Using the following code... cssmin: {
options: {
rebase: true,
relativeTo: '<%= compile_dir %>',
target: '<%= compile_dir %>',
keepSpecialComments: 0,
advanced: true
},
bin: {
files: [{
src: [
'<%= vendor_files.css %>',
'<%= compile_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.css'
],
dest: '<%= compile_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.css'
}]
}
}, ...produces different results in different versions of cssmin: Result in v0.11.0 (rebasing produces correctly-formatted path) .k-map .k-marker{background-image:url(../vendor/kendo-ui/styles/Default/markers.png)} Result in v0.12.2 (rebasing produces malformed path, resulting in 404 error) .k-map .k-marker{background-image:url(../../vendor/kendo-ui/styles/Default/markers.png)} |
We're seeing this in production too. Having to stick on v0.11 as later versions produce incorrect url paths. |
We are having the same issue |
I spent some time trying to get rebase working with cssmin for the latest version 1.0.1 and couldn't, until I saw this thread and tried it with version 0.11.0. I finally managed to get it working as I needed with the following options:
So it seems to me there is a problem not only an issue with |
0.12.x versions broke cssmin for me completely. The result is just empty file, because relativeTo is not passed to clear-css (this results in an empty file). Additionally, something's wrong with url rewriting. In 0.11.0, I had just to to pass root to options (and relativeTo was set per file in task itself). Now, relativeTo is gone, there's no way to pass it for every file from grunt config, but even if I fake it and set from config, url rewriting doesn't work.
Simple case:
dist/image.css
expected result
background-image: url('resource/asset/logos/white/logo.png');
actual result
background-image: url('../../resource/asset/logos/white/logo.png');
same config in 0.11.0
background-image: url(/resource/asset/logos/white/logo.png);
(almost correct, but adding the leading / at the beginning - why?)
The text was updated successfully, but these errors were encountered: