code: function writeSourceMap(srcpath, destpath, options, f) {
      var path = require('path')
        , SourceMapGenerator = require('source-map').SourceMapGenerator
        , sourceMap = new SourceMapGenerator({file: path.basename(destpath)})
        , sourceMapDest = destpath + '.map'
        , sourceMappingUrl = encodeURIComponent(path.basename(sourceMapDest))
        , res = f(sourceMap) + (options.sourceMap ?
            '//@ sourceMappingURL=' + sourceMappingUrl + '\n' : ''
          )
        , _ = (function(){
            if (options.sourceMap) {
              grunt.file.write(sourceMapDest, sourceMap.toString());
              grunt.file.copy(srcpath, path.join.apply(path, [
                path.dirname(destpath),
                path.basename(srcpath)
              ]));
            }
          }())
      ;
      return res;
    }
docs: The sources in the source map file are not specified as absolute urls, which means that they will be resolved relative to the location of the source map file.  Also, we specify a relative path for the source mapping url, which causes the script source of the JS to be used as the source origin. Also, this url must adhere to RFC3986.