7

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 ?

Zysce
  • 1,200
  • 1
  • 10
  • 35
  • A simple search said that in the SASS options you can set a document root with `:template_location` – Xorifelse Feb 23 '16 at 16:39
  • I am using a VS extension WebCompiler, not a ruby watcher with the folders sass, stylesheets... I edit my scss file, i save and the VS extension generates the css and min.css files. So, where can i set the option ? – Zysce Feb 24 '16 at 08:16

1 Answers1

11

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"
    }
  }
]
Zysce
  • 1,200
  • 1
  • 10
  • 35