code: function getRoot(cwd, filename, smap) {
      var relativePath = path.relative(cwd, filename);
  
      var segments = relativePath.split('node_modules');
  
      var sourceRoot = smap.getProperty('sourceRoot') || '/source/' + relativePath;
  
      if (segments.length <= 1) {
          return sourceRoot;
      } else {
          return sourceRoot
              .replace(/^\/source\//, '/source/' + pathToPackage());
      }
  
      // it works, somehow ¯\_(ツ)_/¯
      function pathToPackage() {
          var upToNodeModules = segments
              .slice(0, -1)
              .concat('/')
              .join('node_modules');
  
          var packageName = segments[segments.length - 1]
              .split('/', 2)[1]
              + '/';
  
          return upToNodeModules + packageName;
      }
  }
docs: This algorithm is for resolving the sourceRoot property so that it is relative to it's npm package folder instead of just '/source/'