You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
669 B
37 lines
669 B
import { BuildConfig, defineBuildConfig } from "unbuild";
|
|
import { merge } from "lodash-es";
|
|
|
|
// OR tsup
|
|
|
|
const BaseConfig = {
|
|
entries: [
|
|
"src/index.ts",
|
|
{
|
|
input: "src/",
|
|
outDir: "dist/esm/",
|
|
format: "esm",
|
|
ext: "mjs",
|
|
declaration: true,
|
|
},
|
|
{
|
|
input: "src/",
|
|
outDir: "dist/cjs/",
|
|
format: "cjs",
|
|
ext: "cjs",
|
|
declaration: true,
|
|
},
|
|
],
|
|
declaration: true,
|
|
replace: {},
|
|
rollup: {
|
|
emitCJS: true,
|
|
output: {
|
|
exports: "named"
|
|
}
|
|
},
|
|
} as BuildConfig;
|
|
|
|
|
|
export function mergeConfig(targetConfig: BuildConfig) {
|
|
return defineBuildConfig(merge(BaseConfig, targetConfig))
|
|
}
|
|
|