// src/actions/package/compile/entryOutputName.ts
import path from "node:path";
var platformSourceSegments = /* @__PURE__ */ new Set(["browser", "neutral", "node"]);
var toPosixPath = (value) => value.split(path.sep).join("/");
var normalizeEntryPath = (entry) => toPosixPath(entry).replace(/^\.?\//u, "");
var customEntryOutputName = (entry) => {
  const parsed = path.posix.parse(normalizeEntryPath(entry));
  const withoutExtension = path.posix.join(parsed.dir, parsed.name);
  const segments = withoutExtension.split("/");
  return segments.length > 1 && platformSourceSegments.has(segments[0]) ? segments.slice(1).join("/") : withoutExtension;
};
var entryOutputBasename = (entry, entryMode) => {
  if (entryMode === "custom") return customEntryOutputName(entry);
  return path.posix.parse(normalizeEntryPath(entry)).name;
};
export {
  customEntryOutputName,
  entryOutputBasename,
  normalizeEntryPath,
  toPosixPath
};
//# sourceMappingURL=entryOutputName.mjs.map
