function replaceToMonoRepoPath(pathStr, pkgs) {
    let result = pathStr;
    pkgs.some(({ path: p, name }) => {
      // for instance ./packages/lea-tabs/lea-tabs.js  starts with 'packages/lea-tabs'
      const normalizedP = `./${p}`;
      if (pathStr.startsWith(normalizedP)) {
        const localPath = pathStr.replace(normalizedP, ''); // 'lea-tabs.js'
        result = toPosixPath(path.join(name, localPath)); // 'lea-tabs/lea-tabs.js'
        return true;
      }
      return false;
    });
    return result;
  }
@param {string} pathStr ./packages/lea-tabs/lea-tabs.js
@param {{path:string;name:string}[]} pkgs ['packages/lea-tabs', ...]