@storm-software/build-tools
Version:
A comprehensive set of tools for building and managing projects within a Storm workspace. Includes builders such as rollup, rolldown, tsup, and unbuild, along with various utilities.
23 lines (21 loc) • 456 B
JavaScript
// src/utilities/get-out-extension.ts
function getOutExtension(format, pkgType) {
let jsExtension = ".js";
const dtsExtension = ".d.ts";
if (pkgType === "module" && format === "cjs") {
jsExtension = ".cjs";
}
if (pkgType !== "module" && format === "esm") {
jsExtension = ".mjs";
}
if (format === "iife") {
jsExtension = ".global.js";
}
return {
js: jsExtension,
dts: dtsExtension
};
}
export {
getOutExtension
};