function toLocalPath(currentDirPath, resolvedPath) {
  let relativeSourcePath = path.relative(currentDirPath, resolvedPath);
  if (!relativeSourcePath.startsWith('.')) {
    // correction on top of path.resolve, which resolves local paths like
    // (from import perspective) external modules.
    // so 'my-local-files.js' -> './my-local-files.js'
    relativeSourcePath = `./${relativeSourcePath}`;
  }
  return /** @type {PathRelative} */ (toPosixPath(relativeSourcePath));
}
@param {PathFromSystemRoot} currentDirPath
@param {PathFromSystemRoot} resolvedPath
@returns {PathRelative}