Commit 0b2316d6 by Daniel Knell

fix to allow node-sass to pipe content with embedded sourcemap to other tools

parent 75f2daa1
...@@ -57,7 +57,7 @@ module.exports = function(options, emitter) { ...@@ -57,7 +57,7 @@ module.exports = function(options, emitter) {
if (!destination || stdin) { if (!destination || stdin) {
emitter.emit('log', result.css.toString()); emitter.emit('log', result.css.toString());
if (sourceMap) { if (sourceMap && !options.sourceMapEmbed) {
emitter.emit('log', result.map.toString()); emitter.emit('log', result.map.toString());
} }
......
...@@ -470,6 +470,26 @@ describe('cli', function() { ...@@ -470,6 +470,26 @@ describe('cli', function() {
done(); done();
}); });
}); });
it('should compile with the --source-map-embed option and no outfile', function(done) {
var src = fixture('source-map-embed/index.scss');
var expectedCss = read(fixture('source-map-embed/expected.css'), 'utf8').trim().replace(/\r\n/g, '\n');
var result = '';
var bin = spawn(cli, [
src,
'--source-map-embed',
'--source-map', 'true'
]);
bin.stdout.on('data', function(data) {
result += data;
});
bin.once('close', function() {
assert.equal(result.trim().replace(/\r\n/g, '\n'), expectedCss);
done();
});
});
}); });
describe('node-sass sass/ --output css/', function() { describe('node-sass sass/ --output css/', function() {
......
#navbar {
width: 80%;
height: 23px; }
#navbar ul {
list-style-type: none; }
#navbar li {
float: left; }
#navbar li a {
font-weight: bold; }
/*# sourceMappingURL=data:application/json;base64,ewoJInZlcnNpb24iOiAzLAoJImZpbGUiOiAiZml4dHVyZXMvc291cmNlLW1hcC1lbWJlZC9pbmRleC5jc3MiLAoJInNvdXJjZXMiOiBbCgkJImZpeHR1cmVzL3NvdXJjZS1tYXAtZW1iZWQvaW5kZXguc2NzcyIKCV0sCgkibWFwcGluZ3MiOiAiQUFBQSxPQUFPLENBQUM7RUFDTixLQUFLLEVBQUUsR0FBSTtFQUNYLE1BQU0sRUFBRSxJQUFLLEdBQ2Q7O0FBRUQsT0FBTyxDQUFDLEVBQUUsQ0FBQztFQUNULGVBQWUsRUFBRSxJQUFLLEdBQ3ZCOztBQUVELE9BQU8sQ0FBQyxFQUFFLENBQUM7RUFDVCxLQUFLLEVBQUUsSUFBSyxHQUtiO0VBTkQsT0FBTyxDQUFDLEVBQUUsQ0FHUixDQUFDLENBQUM7SUFDQSxXQUFXLEVBQUUsSUFBSyxHQUNuQiIsCgkibmFtZXMiOiBbXQp9 */
\ No newline at end of file
#navbar {
width: 80%;
height: 23px;
}
#navbar ul {
list-style-type: none;
}
#navbar li {
float: left;
a {
font-weight: bold;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment