function isMatchingImport(importSpecifier, importPath, filename, rootDir) {
  // is this a non-bare import
  if (
    importSpecifier.startsWith('../') ||
    importSpecifier.startsWith('./') ||
    importSpecifier.startsWith('/')
  ) {
    const partialImportFilePath = importSpecifier.split('/').join(path.sep);
    const joinBase = importSpecifier.startsWith('/') ? rootDir : path.dirname(filename);
    const importFilePath = path.join(joinBase, partialImportFilePath);

    return importFilePath === importPath || `${importFilePath}.js` === importPath;
  }

  // this is a bare import
  return importPath === importSpecifier || `${importPath}.js` === importSpecifier;
}
@param {string} importSpecifier
@param {string} importPath
@param {string} filename
@param {string} rootDir
@returns {boolean}