2023-05-24 16:21:38 +00:00
|
|
|
import { defineConfig } from "tsup";
|
|
|
|
|
import { polyfillNode } from "esbuild-plugin-polyfill-node";
|
2023-05-29 02:09:44 +00:00
|
|
|
import { dependencies } from "./package.json";
|
2023-05-24 16:21:38 +00:00
|
|
|
|
2023-05-29 02:09:44 +00:00
|
|
|
export default async () => [
|
2023-05-24 16:21:38 +00:00
|
|
|
defineConfig({
|
|
|
|
|
name: "lib-node",
|
|
|
|
|
entry: ["src/index.ts"],
|
|
|
|
|
platform: "node",
|
|
|
|
|
format: ["cjs"],
|
|
|
|
|
sourcemap: true,
|
|
|
|
|
clean: true,
|
|
|
|
|
}),
|
|
|
|
|
defineConfig({
|
|
|
|
|
name: "lib-browser",
|
|
|
|
|
entry: ["src/index.ts"],
|
|
|
|
|
platform: "browser",
|
|
|
|
|
format: ["iife"],
|
|
|
|
|
globalName: "Tabby",
|
|
|
|
|
sourcemap: true,
|
|
|
|
|
esbuildPlugins: [polyfillNode()],
|
|
|
|
|
clean: true,
|
|
|
|
|
}),
|
|
|
|
|
defineConfig({
|
|
|
|
|
name: "lib-typedefs",
|
|
|
|
|
entry: ["src/index.ts"],
|
|
|
|
|
dts: {
|
|
|
|
|
only: true,
|
|
|
|
|
},
|
|
|
|
|
clean: true,
|
|
|
|
|
}),
|
|
|
|
|
defineConfig({
|
|
|
|
|
name: "cli",
|
|
|
|
|
entry: ["src/cli.ts"],
|
|
|
|
|
platform: "node",
|
2023-05-29 02:09:44 +00:00
|
|
|
noExternal: Object.keys(dependencies),
|
2023-05-24 16:21:38 +00:00
|
|
|
minify: true,
|
|
|
|
|
clean: true,
|
|
|
|
|
}),
|
|
|
|
|
];
|