scripts/build/esbuild-plugins/replace-module.mjs/esbuildPluginReplaceModule
export default function esbuildPluginReplaceModule({
  onLoadConcepts = DEFAULT_ON_LOAD_CONCEPTS,
  onResolveConcepts = DEFAULT_ON_RESOLVE_CONCEPTS,
  replacements,
}) {
  const { onResolveReplacements, onLoadReplacements, onLoadProcessors } =
    processReplacements(replacements);
  const onResolveListenerOptions = {
    concepts: onResolveConcepts,
    replacements: onResolveReplacements,
  };
  const onLoadListenerOptions = {
    concepts: onLoadConcepts,
    replacements: onLoadReplacements,
    processors: onLoadProcessors,
  };

  return {
    name: "replace-module",
    setup(build) {
      setupOnResolveListener(build, onResolveListenerOptions);
      setupOnLoadListener(build, onLoadListenerOptions);
    },
  };
}