mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
24 lines
695 B
TypeScript
24 lines
695 B
TypeScript
import { defineConfig } from "tsup";
|
|
|
|
import { lodashReplacePlugin } from "../shared/lodash-replace-plugin";
|
|
import { markAsExternalPlugin } from "../shared/mark-as-external-plugin";
|
|
|
|
export default defineConfig((options) => ({
|
|
entry: ["src/index.ts"],
|
|
splitting: false,
|
|
sourcemap: true,
|
|
clean: false,
|
|
minify: true,
|
|
format: ["cjs", "esm"],
|
|
outExtension: ({ format }) => ({ js: format === "cjs" ? ".cjs" : ".mjs" }),
|
|
platform: "browser",
|
|
esbuildPlugins: [lodashReplacePlugin, markAsExternalPlugin],
|
|
esbuildOptions(options) {
|
|
options.keepNames = true;
|
|
options.banner = {
|
|
js: '"use client"',
|
|
};
|
|
},
|
|
onSuccess: options.watch ? "pnpm types" : undefined,
|
|
}));
|