'use strict';

var chunk3RZI265Q_cjs = require('./chunk-3RZI265Q.cjs');
var chunkPZELMXXD_cjs = require('./chunk-PZELMXXD.cjs');
var chunkAF3E2D32_cjs = require('./chunk-AF3E2D32.cjs');
var noop = require('@stryke/helpers/noop');
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: [
      chunk3RZI265Q_cjs.externalPlugin(noop.noop, {
        external: context.external,
        noExternal: context.noExternal,
        skipNodeModulesBundle: true
      }, context.resolvedTsconfig.tsconfigJson.compilerOptions?.paths),
      chunkPZELMXXD_cjs.compilerPlugin(noop.noop, 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-4P7EMDB7.cjs.map
//# sourceMappingURL=chunk-4P7EMDB7.cjs.map