code: function buildExportNameListDeclaration(
    programPath: NodePath,
    metadata: ModuleMetadata,
  ) {
    const exportedVars = Object.create(null);
    for (const data of metadata.local.values()) {
      for (const name of data.names) {
        exportedVars[name] = true;
      }
    }
  
    let hasReexport = false;
    for (const data of metadata.source.values()) {
      for (const exportName of data.reexports.keys()) {
        exportedVars[exportName] = true;
      }
      for (const exportName of data.reexportNamespace) {
        exportedVars[exportName] = true;
      }
  
      hasReexport = hasReexport || data.reexportAll;
    }
  
    if (!hasReexport || Object.keys(exportedVars).length === 0) return null;
  
    const name = programPath.scope.generateUidIdentifier("exportNames");
  
    delete exportedVars.default;
  
    return {
      name: name.name,
      statement: t.variableDeclaration("var", [
        t.variableDeclarator(name, t.valueToNode(exportedVars)),
      ]),
    };
  }
docs: Build a statement declaring a variable that contains all of the exported
  variable names in an object so they can easily be referenced from an
  export * from statement to check for conflicts.