'use strict';

var chunk5X442PKU_cjs = require('./chunk-5X442PKU.cjs');
var chunkULD5XAAD_cjs = require('./chunk-ULD5XAAD.cjs');
var chunkAF3E2D32_cjs = require('./chunk-AF3E2D32.cjs');
var filePathFns = require('@stryke/path/file-path-fns');
var defu = require('defu');
var esbuild = require('esbuild');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var defu__default = /*#__PURE__*/_interopDefault(defu);

async function bundle(context, entryPoint, outputDir, override = {}, options) {
  const esbuildOptions = defu__default.default(override ?? {}, context.override, {
    entryPoints: [
      entryPoint
    ],
    platform: "node",
    format: "esm",
    minify: false,
    sourcemap: false,
    bundle: true,
    treeShaking: true,
    keepNames: true,
    splitting: false,
    preserveSymlinks: true,
    outdir: outputDir,
    logLevel: "silent",
    plugins: [
      chunkULD5XAAD_cjs.externalPlugin({
        external: context.options.external,
        noExternal: context.options.noExternal,
        skipNodeModulesBundle: true
      }, context.tsconfig.options?.paths),
      chunk5X442PKU_cjs.compilerPlugin(context, options)
    ]
  });
  esbuildOptions.alias = Object.entries(esbuildOptions.alias ?? {}).reduce((ret, [key, value]) => {
    ret[key] = filePathFns.relativePath(filePathFns.findFilePath(entryPoint), value);
    return ret;
  }, {});
  return esbuild.build(esbuildOptions);
}
chunkAF3E2D32_cjs.__name(bundle, "bundle");

exports.bundle = bundle;
//# sourceMappingURL=chunk-SLZS6XBQ.cjs.map
//# sourceMappingURL=chunk-SLZS6XBQ.cjs.map