function rootDirResolve(filePath, link, rootDir = process.cwd()) {
  if (link.startsWith('//') || link.startsWith('http')) {
    return '';
    // we do not handle remote files (yet)
  }
  if (link.startsWith('/')) {
    return path.join(rootDir, link);
  }
  return path.relative(rootDir, path.join(path.dirname(filePath), link));
}
@param {string} filePath
@param {string} link
@param {string} rootDir