{
  "version": 3,
  "sources": ["../../src/config/load.ts"],
  "sourceRoot": "file://",
  "sourcesContent": ["/**\n * @file Config - loadBuildConfig\n * @module mkbuild/config/loadBuildConfig\n */\n\nimport type { Config } from '#src/interfaces'\nimport pathe from '@flex-development/pathe'\nimport { DOT, cast, get } from '@flex-development/tutils'\nimport { cosmiconfig } from 'cosmiconfig'\nimport es from './loader-es'\n\n/**\n * Searches for a build configuration file.\n *\n * If found, a config object will be returned. The object will contain options\n * from the config file. If not found, an empty object will be returned.\n *\n * @see https://github.com/davidtheclark/cosmiconfig#explorersearch\n *\n * @async\n *\n * @param {string} [location=DOT] - Directory to search\n * @return {Config} Build configuration options\n */\nconst loadBuildConfig = async (location: string = DOT): Promise<Config> => {\n  /**\n   * Module name.\n   *\n   * @const {string} name\n   */\n  const name: string = 'build'\n\n  // get search function\n  const { search } = cosmiconfig(name, {\n    loaders: { '.cts': es, '.js': es, '.mjs': es, '.mts': es, '.ts': es },\n    searchPlaces: [\n      '#.config.cjs',\n      '#.config.cts',\n      '#.config.js',\n      '#.config.json',\n      '#.config.mjs',\n      '#.config.mts',\n      '#.config.ts'\n    ].map(place => place.replace('#', name)),\n    stopDir: pathe.resolve(location)\n  })\n\n  return cast(get((await search(location)) ?? undefined, 'config', {}))\n}\n\nexport default loadBuildConfig\n"],
  "mappings": ";;AAMA,OAAO,WAAW;AAClB,SAAS,KAAK,MAAM,WAAW;AAC/B,SAAS,mBAAmB;AAC5B,OAAO,QAAQ;AAef,MAAM,kBAAkB,8BAAO,WAAmB,QAAyB;AAMzE,QAAM,OAAe,SAGf,EAAE,OAAO,IAAI,YAAY,MAAM;AAAA,IACnC,SAAS,EAAE,QAAQ,IAAI,OAAO,IAAI,QAAQ,IAAI,QAAQ,IAAI,OAAO,GAAG;AAAA,IACpE,cAAc;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,IAAI,WAAS,MAAM,QAAQ,KAAK,IAAI,CAAC;AAAA,IACvC,SAAS,MAAM,QAAQ,QAAQ;AAAA,EACjC,CAAC;AAED,SAAO,KAAK,IAAK,MAAM,OAAO,QAAQ,KAAM,QAAW,UAAU,CAAC,CAAC,CAAC;AACtE,GAxBwB;AA0BxB,IAAO,eAAQ;",
  "names": []
}
