mrcrowl / vscode-easy-less

Easy LESS extension for Visual Studio Code
MIT License
67 stars 23 forks source link

Support for sourceMapRootpath option #16

Closed tobyee closed 7 years ago

tobyee commented 7 years ago

I want to compile the master less file rather than the one being edited. The configuration shows follow according to FAQ.

Global Configuration (settings.json)

{    
     "less.compile": {
         "compress":  true,
         "sourceMap": true,
         "out": false,
         "main": "${workspaceRoot}\\src\\assets\\css\\styles.less"
     }
 }

Main File Header (styles.less)

// out: true
@import "xx.less";
@import "yy.less";

The problem is that the path generated by less in sourceMap is combining the absoluate path.

image

Suggestion Add sourceMapRootPath option support. Override this option while specified, see codes here: https://github.com/mrcrowl/vscode-easy-less/blob/master/src/LessCompiler.ts#L96-L102