function successHandler(css, map) {

          // adjust sourcemap
          var source = minimatch.makeRe(file.cwd).source
            .replace(/^\^|\$$/g, '')          // match text anywhere on the line by removing line start/end
            .replace(/\\\//g, '[\\\\\\/]') +  // detect any platform path format
            '|\\.\\.\\/';  			              // relative paths are an artifact and must be removed
          var parsable  = slash(map.replace(new RegExp(source, 'g'), ''));
          var sourceMap = JSON.parse(parsable);
          sourceMap.sources.forEach(function (value, i, array) {
            array[i] = path.resolve(value.replace(/^\//, '').replace(/\b\/+\b/g, '/'));  // ensure single slash absolute
          });
          sourceMapConsumer = new SourceMapConsumer(sourceMap);

          // embed sourcemap in css
          var cssWithMap = css.replace(
            /\/\*#\s*sourceMappingURL=[^*]*\*\//m,
            '/*# sourceMappingURL=data:application/json;base64,' + convert.fromObject(sourceMap).toBase64() + ' */'
          );

          // rework css
          var reworked = rework(cssWithMap, '')
            .use(reworkPlugin)
            .toString({
              sourcemap: true,
              sourcemapAsObject: true
            });

          // adjust overall sourcemap
          delete reworked.map.file;
          delete reworked.map.sourcesContent;
          reworked.map.sources.forEach(function (value, i, array) {
            array[i] = '/' + path.relative(process.cwd(), value);   // ensure root relative
          });

          // write stream output
          pushResult('.css', reworked.code + '\n/*# sourceMappingURL=' + mapName  + ' */');
          pushResult('.css.map', JSON.stringify(reworked.map, null, '  '));
          done();
        }
/**
         * Handler for successful transpilation using node-sass.
         * @param {string} css Compiled css
         * @param {string} map The source-map for the compiled css
         */
Handler for successful transpilation using node-sass.
@param {string} css Compiled css
@param {string} map The source-map for the compiled css
Handler for successful transpilation using node - sass . @param { string } css Compiled css @param { string } map The source - map for the compiled css
function successHandler(css, map) {
          var source = minimatch.makeRe(file.cwd).source
            .replace(/^\^|\$$/g, '')          
            .replace(/\\\//g, '[\\\\\\/]') +  
            '|\\.\\.\\/';  			              
          var parsable  = slash(map.replace(new RegExp(source, 'g'), ''));
          var sourceMap = JSON.parse(parsable);
          sourceMap.sources.forEach(function (value, i, array) {
            array[i] = path.resolve(value.replace(/^\//, '').replace(/\b\/+\b/g, '/'));  
          });
          sourceMapConsumer = new SourceMapConsumer(sourceMap);
          var cssWithMap = css.replace(
            /\/\*#\s*sourceMappingURL=[^*]*\*\//m,
            '/*# sourceMappingURL=data:application/json;base64,' + convert.fromObject(sourceMap).toBase64() + ' */'
          );
          var reworked = rework(cssWithMap, '')
            .use(reworkPlugin)
            .toString({
              sourcemap: true,
              sourcemapAsObject: true
            });
          delete reworked.map.file;
          delete reworked.map.sourcesContent;
          reworked.map.sources.forEach(function (value, i, array) {
            array[i] = '/' + path.relative(process.cwd(), value);   
          });
          pushResult('.css', reworked.code + '\n/*# sourceMappingURL=' + mapName  + ' */');
          pushResult('.css.map', JSON.stringify(reworked.map, null, '  '));
          done();
        }
function successHandler ( css , map ) { var source = minimatch . makeRe ( file . cwd ) . source . replace ( / ^\^|\$$ / g , '' ) . replace ( / \\\/ / g , '[\\\\\\/]' ) + '|\\.\\.\\/' ; var parsable = slash ( map . replace ( new RegExp ( source , 'g' ) , '' ) ) ; var sourceMap = JSON . parse ( parsable ) ; sourceMap . sources . forEach ( function ( value , i , array ) { array [ i ] = path . resolve ( value . replace ( / ^\/ / , '' ) . replace ( / \b\/+\b / g , '/' ) ) ; } ) ; sourceMapConsumer = new SourceMapConsumer ( sourceMap ) ; var cssWithMap = css . replace ( / \/\*#\s*sourceMappingURL=[^*]*\*\/ / m , '/*# sourceMappingURL=data:application/json;base64,' + convert . fromObject ( sourceMap ) . toBase64 ( ) + ' */' ) ; var reworked = rework ( cssWithMap , '' ) . use ( reworkPlugin ) . toString ( { sourcemap : true , sourcemapAsObject : true } ) ; delete reworked . map . file ; delete reworked . map . sourcesContent ; reworked . map . sources . forEach ( function ( value , i , array ) { array [ i ] = '/' + path . relative ( process . cwd ( ) , value ) ; } ) ; pushResult ( '.css' , reworked . code + '\n/*# sourceMappingURL=' + mapName + ' */' ) ; pushResult ( '.css.map' , JSON . stringify ( reworked . map , null , '  ' ) ) ; done ( ) ; }
Handler for successful transpilation using node-sass.
Handler for successful transpilation using node - sass .
// adjust sourcemap // match text anywhere on the line by removing line start/end // detect any platform path format // relative paths are an artifact and must be removed // ensure single slash absolute // embed sourcemap in css // rework css // adjust overall sourcemap // ensure root relative // write stream output