Skip to content

What happened to relativeTo? #196

@sebastian-zarzycki

Description

@sebastian-zarzycki

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:

  • css file sitting in ./client/style/application/image.css
  • in it, as part of class def : background-image: url('../../resource/asset/logos/white/logo.png');
  • target dir, dist, has ./dist/resource/(...) in it
  • grunt:
cssmin: {
    options: {
        keepSpecialComments: 0,
        root: 'client'
    }
    custom: {
        files: [
            {
                src: ['client/style/application/image.css'],
                dest: 'dist/image.css'
            }
        ]
    }
}

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?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions