File tree Expand file tree Collapse file tree 4 files changed +26
-6
lines changed Expand file tree Collapse file tree 4 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 1+ ## 1.26.8  
2+ 
3+ *  Fixes an error when emitting source maps to stdout.
4+ 
15## 1.26.7  
26
37*  No user-visible changes.
Original file line number Diff line number Diff line change @@ -388,6 +388,11 @@ class ExecutableOptions {
388388    return  extension  ==  ".scss"  ||  extension  ==  ".sass"  ||  extension  ==  ".css" ;
389389  }
390390
391+   /// Returns whether we're writing to stdout instead of a file or files. 
392+    bool  get  _writeToStdout => 
393+       sourcesToDestinations.length ==  1  && 
394+       sourcesToDestinations.values.single ==  null ;
395+ 
391396  /// Whether to emit a source map file. 
392397   bool  get  emitSourceMap {
393398    if  (! (_options['source-map' ] as  bool )) {
@@ -399,10 +404,7 @@ class ExecutableOptions {
399404        _fail ("--embed-source-map isn't allowed with --no-source-map." );
400405      }
401406    }
402- 
403-     var  writeToStdout =  sourcesToDestinations.length ==  1  && 
404-         sourcesToDestinations.values.single ==  null ;
405-     if  (! writeToStdout) return  _options['source-map' ] as  bool ;
407+     if  (! _writeToStdout) return  _options['source-map' ] as  bool ;
406408
407409    if  (_ifParsed ('source-map-urls' ) ==  'relative' ) {
408410      _fail (
@@ -458,7 +460,7 @@ class ExecutableOptions {
458460    if  (url.scheme.isNotEmpty &&  url.scheme !=  'file' ) return  url;
459461
460462    var  path =  p.fromUri (url);
461-     return  p.toUri (_options['source-map-urls' ] ==  'relative' 
463+     return  p.toUri (_options['source-map-urls' ] ==  'relative'   &&   ! _writeToStdout 
462464        ?  p.relative (path, from:  p.dirname (destination))
463465        :  p.absolute (path));
464466  }
Original file line number Diff line number Diff line change 11name : sass 
2- version : 1.26.7  
2+ version : 1.26.8  
33description : A Sass implementation in Dart. 
44author : Sass Team 
55homepage : https://github.com/sass/dart-sass 
Original file line number Diff line number Diff line change @@ -342,6 +342,20 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
342342        expect (map, containsPair ("file" , "out.css" ));
343343      });
344344    });
345+ 
346+     test ("with stdout as the target" , () async  {
347+       var  sass =  await  runSass (["--embed-source-map" , "test.scss" ]);
348+       expect (
349+           sass.stdout,
350+           emitsInOrder ([
351+             "a {" ,
352+             "  b: 3;" ,
353+             "}" ,
354+             "" ,
355+             startsWith ("/*# sourceMappingURL=data:" )
356+           ]));
357+       await  sass.shouldExit (0 );
358+     });
345359  });
346360}
347361
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments