@storm-stack/core
Version: 
A build toolkit and runtime used by Storm Software in TypeScript applications
66 lines (60 loc) • 2.65 kB
JavaScript
;
var chunkHDN7I5AG_cjs = require('./chunk-HDN7I5AG.cjs');
var chunkGRNJVY7I_cjs = require('./chunk-GRNJVY7I.cjs');
var defu = require('defu');
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
var defu__default = /*#__PURE__*/_interopDefault(defu);
function resolveTsupEntryOptions(context, entryPoints) {
  return chunkHDN7I5AG_cjs.resolveEsbuildEntryOptions(context, entryPoints);
}
chunkGRNJVY7I_cjs.__name(resolveTsupEntryOptions, "resolveTsupEntryOptions");
function resolveTsupOptions(context, override = {}) {
  return defu__default.default({
    alias: context.vfs.runtimeIdMap.keys().reduce((ret, id) => {
      const path = context.vfs.runtimeIdMap.get(id);
      if (path) {
        ret[id] = path;
      }
      return ret;
    }, {})
  }, override, context.options.variant === "tsup" || context.options.variant === "standalone" && context.options.projectType === "application" ? context.options.override : {}, {
    external: context.options.external,
    noExternal: context.options.noExternal,
    skipNodeModulesBundle: context.options.skipNodeModulesBundle
  }, {
    name: context.options.name,
    globalName: override.globalName,
    minify: context.options.mode !== "development",
    metafile: context.options.mode === "development",
    sourcemap: context.options.mode === "development",
    dts: context.options.projectType !== "application",
    bundle: override?.bundle,
    treeshake: context.options.build?.treeshake || context.options.build?.treeShaking,
    assets: context.options.output.assets,
    outputPath: context.options.output.outputPath,
    mode: context.options.mode,
    platform: context.options.platform,
    projectRoot: context.options.projectRoot,
    sourceRoot: context.options.sourceRoot,
    outdir: context.options.output.outputPath,
    tsconfig: context.tsconfig.tsconfigFilePath,
    tsconfigRaw: context.tsconfig.tsconfigJson,
    noExternal: Array.from(context.vfs.runtimeIdMap.keys())
  }, context.options.variant === "tsup" || context.options.variant === "standalone" && context.options.projectType === "application" ? context.options.build : {}, {
    banner: {
      js: context.options.mode !== "production" ? "\n//  \u26A1  Built with Storm Stack \n" : " "
    },
    platform: "neutral",
    format: "esm",
    minify: true,
    sourcemap: false,
    bundle: true,
    treeshake: true,
    keepNames: true,
    splitting: true,
    logLevel: "silent"
  });
}
chunkGRNJVY7I_cjs.__name(resolveTsupOptions, "resolveTsupOptions");
exports.resolveTsupEntryOptions = resolveTsupEntryOptions;
exports.resolveTsupOptions = resolveTsupOptions;