Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for embedding source files into the source map #443

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ SASSC_BIN = $(SASS_SASSC_PATH)/bin/sassc
RUBY_BIN = ruby

SOURCES = \
json.cpp \
ast.cpp \
base64vlq.cpp \
bind.cpp \
Expand All @@ -40,7 +41,7 @@ SOURCES = \
file.cpp \
functions.cpp \
inspect.cpp \
node.cpp \
json.cpp \
output_compressed.cpp \
output_nested.cpp \
parser.cpp \
Expand Down
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ libsass_la_SOURCES = \
functions.cpp \
inspect.cpp \
node.cpp \
json.cpp \
output_compressed.cpp \
output_nested.cpp \
parser.cpp \
Expand Down
9 changes: 5 additions & 4 deletions context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ namespace Sass {
source_comments (initializers.source_comments()),
output_style (initializers.output_style()),
source_map_file (make_canonical_path(initializers.source_map_file())),
source_map_sources (initializers.source_map_sources()),
omit_source_map_url (initializers.omit_source_map_url()),
is_indented_syntax_src (initializers.is_indented_syntax_src()),
names_to_colors (map<string, Color*>()),
Expand Down Expand Up @@ -159,7 +160,7 @@ namespace Sass {
sources.push_back(contents);
included_files.push_back(real_path);
queue.push_back(make_pair(full_path, contents));
source_map.files.push_back(resolve_relative_path(real_path, source_map_file, cwd));
source_map.files.push_back(make_pair(resolve_relative_path(real_path, source_map_file, cwd), contents));
style_sheets[full_path] = 0;
return full_path;
}
Expand All @@ -180,7 +181,7 @@ namespace Sass {
sources.push_back(contents);
included_files.push_back(real_path);
queue.push_back(make_pair(full_path, contents));
source_map.files.push_back(resolve_relative_path(real_path, source_map_file, cwd));
source_map.files.push_back(make_pair(resolve_relative_path(real_path, source_map_file, cwd), contents));
style_sheets[full_path] = 0;
return full_path;
}
Expand All @@ -192,7 +193,7 @@ namespace Sass {
sources.push_back(contents);
included_files.push_back(real_path);
queue.push_back(make_pair(full_path, contents));
source_map.files.push_back(resolve_relative_path(real_path, source_map_file, cwd));
source_map.files.push_back(make_pair(resolve_relative_path(real_path, source_map_file, cwd), contents));
style_sheets[full_path] = 0;
return full_path;
}
Expand Down Expand Up @@ -273,7 +274,7 @@ namespace Sass {
{
if (source_map_file == "") return 0;
char* result = 0;
string map = source_map.generate_source_map();
string map = source_map.generate_source_map(source_map_sources);
result = copy_c_str(map.c_str());
return result;
}
Expand Down
1 change: 1 addition & 0 deletions context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ namespace Sass {
bool source_comments; // for inline debug comments in css output
Output_Style output_style; // output style for the generated css code
string source_map_file; // path to source map file (enables feature)
bool source_map_sources;
bool omit_source_map_url; // disable source map comment in css output
bool is_indented_syntax_src; // treat source string as sass

Expand Down
Loading