Skip to content

Commit

Permalink
Sass: Added "sourceMapRoot" option. Fixed #141
Browse files Browse the repository at this point in the history
  • Loading branch information
madskristensen committed Oct 21, 2015
1 parent bc2816e commit 874f7bf
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [ ] Run compilers from a node server
- [x] Default settings for source maps (#120)
- [x] Support for Stylus compilation
- [x] Sass: Added _sourceMapRoot_ option (#141)
- [x] Fixed: Support for Sass' _include-path_ (#137)
- [x] Fixed: CSS minification stripped selector spaces (#138)

Expand Down
3 changes: 3 additions & 0 deletions src/WebCompiler/Compile/SassCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ private static string ConstructArguments(Config config)
if (!string.IsNullOrEmpty(options.IncludePath))
arguments += " --include-path=" + options.IncludePath;

if (!string.IsNullOrEmpty(options.SourceMapRoot))
arguments += " --source-map-root=" + options.SourceMapRoot;

return arguments;
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/WebCompiler/Compile/SassOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ protected override void LoadSettings(Config config)
var includePath = GetValue(config, "includePath");
if (includePath != null)
IncludePath = includePath;

var sourceMapRoot = GetValue(config, "sourceMapRoot");
if (sourceMapRoot != null)
SourceMapRoot = sourceMapRoot;
}

/// <summary>
Expand Down Expand Up @@ -87,5 +91,11 @@ protected override string CompilerFileName
/// </summary>
[JsonProperty("relativeUrls")]
public bool RelativeUrls { get; set; } = true;

/// <summary>
/// Base path, will be emitted in source-map as is
/// </summary>
[JsonProperty("soruceMapRoot")]
public string SourceMapRoot { get; set; }
}
}
4 changes: 4 additions & 0 deletions src/WebCompilerVsix/JSON/compilerdefaults-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
"description": "Generates a base64 encoded source map at the bottom of the output.",
"type": "boolean",
"default": false
},
"sourceMapRoot": {
"description": "Scss only. Base path, will be emitted in source-map as is.",
"type": "string"
}
}
},
Expand Down

0 comments on commit 874f7bf

Please sign in to comment.