Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sass - Web Compiler replaces Url as relatives urls

I have a problem with Web Compiler with VS2015 Update 1 and Sass.

In my Scss file, i declared some images as background.

Example :

.example {
     background-image: url(images/ex.jpg);
}

In the file compilerconfig.json, the outPutFile is not in the same directory. In the file compilerconfig.json.defaults, i set relativeUrls as false in sass section. When i compile, url becomes relative like :

.example {
         background-image: url(../../../../../images/ex.jpg);
    } 

I have the same problem with imported file.

Is there any way to resolve this ?

like image 939
Zysce Avatar asked Feb 23 '16 16:02

Zysce


1 Answers

I found how to disable relative urls : the option is not to set in the file compilerconfig.json.defaults but in compilerconfig.json :

[
  {
    "outputFile": "../../../../../inetpub/wwwroot/ui/skins/test.css",
    "inputFile": "Web/Stylesheets/test.scss",
    "minify": {
      "termSemicolons": true
    },
    "options": {
      "relativeUrls": false,
      "lineFeed": "crlf"
    }
  }
]
like image 133
Zysce Avatar answered Nov 01 '22 01:11

Zysce