{
  "version": 3,
  "sources": ["../../../src/config/configurators/esbuild.configurator.mts"],
  "sourcesContent": ["/*\n * Copyright (c) 2022 Kiyozz.\n *\n * All rights reserved.\n */\n\nimport deepMerge from 'deepmerge'\nimport { BuildOptions } from 'esbuild'\nimport nodeModule from 'node:module'\nimport path from 'node:path'\n\nimport type { Configurator } from './base.configurator.mjs'\nimport type { EnvConfig } from '../config.mjs'\nimport { TypeConfig } from '../enums.mjs'\n\nexport class EsbuildConfigurator implements Configurator<TypeConfig.esbuild> {\n  public readonly type = TypeConfig.esbuild\n\n  constructor(public readonly config: EnvConfig) {}\n\n  toBuilderConfig(\n    partial: Partial<BuildOptions>,\n    userConfig: BuildOptions,\n  ): BuildOptions {\n    const additional: Partial<BuildOptions> = {}\n    const out = path.resolve(\n      process.cwd(),\n      this.config.output.dir,\n      this.config.output.filename,\n    )\n\n    if (userConfig.entryPoints?.length ?? 1 > 1) {\n      additional.outdir = path.dirname(out)\n    } else {\n      additional.outfile = out\n    }\n\n    return deepMerge(\n      deepMerge(\n        partial,\n        {\n          external: [\n            ...(partial.external ?? []),\n            'electron',\n            ...nodeModule.builtinModules,\n          ],\n        },\n        { clone: false },\n      ),\n      additional,\n      { clone: false },\n    )\n  }\n}\n"],
  "mappings": "AAMA,OAAO,eAAe;AAEtB,OAAO,gBAAgB;AACvB,OAAO,UAAU;AAIjB,SAAS,kBAAkB;AAEpB,MAAM,oBAAgE;AAAA,EAG3E,YAA4B,QAAmB;AAAnB;AAF5B,SAAgB,OAAO,WAAW;AAAA,EAEc;AAAA,EAEhD,gBACE,SACA,YACc;AAvBlB;AAwBI,UAAM,aAAoC,CAAC;AAC3C,UAAM,MAAM,KAAK;AAAA,MACf,QAAQ,IAAI;AAAA,MACZ,KAAK,OAAO,OAAO;AAAA,MACnB,KAAK,OAAO,OAAO;AAAA,IACrB;AAEA,UAAI,gBAAW,gBAAX,mBAAwB,WAAU,IAAI,GAAG;AAC3C,iBAAW,SAAS,KAAK,QAAQ,GAAG;AAAA,IACtC,OAAO;AACL,iBAAW,UAAU;AAAA,IACvB;AAEA,WAAO;AAAA,MACL;AAAA,QACE;AAAA,QACA;AAAA,UACE,UAAU;AAAA,YACR,GAAI,QAAQ,YAAY,CAAC;AAAA,YACzB;AAAA,YACA,GAAG,WAAW;AAAA,UAChB;AAAA,QACF;AAAA,QACA,EAAE,OAAO,MAAM;AAAA,MACjB;AAAA,MACA;AAAA,MACA,EAAE,OAAO,MAAM;AAAA,IACjB;AAAA,EACF;AACF;",
  "names": []
}
