print-help/build.config.ts
2024-03-11 18:18:41 +08:00

36 lines
763 B
TypeScript

import { defineBuildConfig } from "unbuild";
import { join } from "node:path";
import { obfuscator } from "rollup-obfuscator";
export default defineBuildConfig({
name: "printHelp",
entries: ["src/index"],
clean: true,
declaration: true,
rollup: {
emitCJS: true,
inlineDependencies: true,
esbuild: {
minify: true,
},
},
alias: {
"@": join(__dirname, "src"),
},
hooks: {
"rollup:options"(_ctx, options) {
if (Array.isArray(options?.plugins)) {
options.plugins.push(
obfuscator({
compact: true,
sourceMap: false,
rotateStringArray: true,
stringArray: true,
stringArrayThreshold: 0.75,
})
);
}
},
},
});