"use strict";

exports.__esModule = true;
exports.setGatsbyPluginCache = setGatsbyPluginCache;
exports.requireGatsbyPlugin = requireGatsbyPlugin;
const pluginModuleCache = new Map();

function setGatsbyPluginCache(plugin, module, moduleObject) {
  const key = `${plugin.name}/${module}`;
  pluginModuleCache.set(key, moduleObject);
}

function requireGatsbyPlugin(plugin, module) {
  const key = `${plugin.name}/${module}`;
  let pluginModule = pluginModuleCache.get(key);

  if (!pluginModule) {
    pluginModule = require(`${(plugin === null || plugin === void 0 ? void 0 : plugin.resolveCompiled) || plugin.resolve}/${module}`);
    pluginModuleCache.set(key, pluginModule);
  }

  return pluginModule;
}
//# sourceMappingURL=require-gatsby-plugin.js.map