Skip to content

Commit c65067a

Browse files
committed
Options: Makes sourceMappingURL disableable.
1 parent 9b4c3a3 commit c65067a

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

libsass/SassInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace LibSassNet
4848
sass_option_set_precision(options, sassContext->Options->Precision);
4949
sass_option_set_linefeed(options, lineFeed);
5050
sass_option_set_include_path(options, includePaths);
51-
sass_option_set_omit_source_map_url(options, true);
51+
sass_option_set_omit_source_map_url(options, sassContext->Options->OmitSourceMappingUrl);
5252

5353
sass_compile_data_context(ctx);
5454

@@ -106,7 +106,7 @@ namespace LibSassNet
106106
sass_option_set_precision(options, sassFileContext->Options->Precision);
107107
sass_option_set_linefeed(options, lineFeed);
108108
sass_option_set_include_path(options, includePaths);
109-
sass_option_set_omit_source_map_url(options, String::IsNullOrEmpty(sassFileContext->OutputSourceMapFile));
109+
sass_option_set_omit_source_map_url(options, sassFileContext->Options->OmitSourceMappingUrl);
110110
sass_option_set_source_map_file(options, mapFile);
111111

112112
sass_compile_file_context(ctx);

libsass/SassOptions.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace LibSassNet
2929
public:
3030
property int OutputStyle;
3131
property bool IncludeSourceComments;
32+
property bool OmitSourceMappingUrl;
3233
property int Precision;
3334
property String^ IncludePaths;
3435
property String^ LineFeed;

libsassnet/SassCompiler.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public class SassCompiler : ISassCompiler
3131

3232
public string OutputLineFeed { get; set; }
3333

34+
public bool OmitSourceMappingUrl { get; set; }
35+
3436
public SassCompiler()
3537
{
3638
_sassInterface = new SassInterface();
@@ -53,7 +55,8 @@ public string Compile(string source, OutputStyle outputStyle = OutputStyle.Neste
5355
IncludeSourceComments = includeSourceComments,
5456
IncludePaths = includePaths != null ? String.Join(";", includePaths) : String.Empty,
5557
Precision = precision,
56-
LineFeed = OutputLineFeed ?? (OutputLineFeed = "\r\n")
58+
LineFeed = OutputLineFeed ?? (OutputLineFeed = "\r\n"),
59+
OmitSourceMappingUrl = OmitSourceMappingUrl
5760
}
5861
};
5962

@@ -87,7 +90,8 @@ public CompileFileResult CompileFile(string inputPath, OutputStyle outputStyle =
8790
IncludeSourceComments = includeSourceComments,
8891
IncludePaths = String.Join(";", includePaths),
8992
Precision = precision,
90-
LineFeed = OutputLineFeed ?? (OutputLineFeed = "\r\n")
93+
LineFeed = OutputLineFeed ?? (OutputLineFeed = "\r\n"),
94+
OmitSourceMappingUrl = OmitSourceMappingUrl
9195
},
9296
OutputSourceMapFile = sourceMapPath
9397
};

0 commit comments

Comments
 (0)