mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
packages
This commit is contained in:
32
packages/devtools-shared/tsup.config.ts
Normal file
32
packages/devtools-shared/tsup.config.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { defineConfig } from "tsup";
|
||||
import { NodeResolvePlugin } from "@esbuild-plugins/node-resolve";
|
||||
|
||||
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: [
|
||||
NodeResolvePlugin({
|
||||
extensions: [".js", "ts", "tsx", "jsx"],
|
||||
onResolved: (resolved) => {
|
||||
if (resolved.includes("node_modules")) {
|
||||
return {
|
||||
external: true,
|
||||
};
|
||||
}
|
||||
return resolved;
|
||||
},
|
||||
}),
|
||||
],
|
||||
esbuildOptions(options) {
|
||||
options.banner = {
|
||||
js: '"use client"',
|
||||
};
|
||||
},
|
||||
onSuccess: options.watch ? "pnpm types" : undefined,
|
||||
}));
|
||||
Reference in New Issue
Block a user