27 lines
751 B
TypeScript
27 lines
751 B
TypeScript
import { defineConfig } from "tsup";
|
|
import { NodeResolvePlugin } from "@esbuild-plugins/node-resolve";
|
|
|
|
export default defineConfig({
|
|
entry: {
|
|
index: "src/index.ts",
|
|
legacy: "src/legacy/index.ts",
|
|
},
|
|
splitting: false,
|
|
sourcemap: true,
|
|
clean: false,
|
|
platform: "browser",
|
|
esbuildPlugins: [
|
|
NodeResolvePlugin({
|
|
extensions: [".js", "ts", "tsx", "jsx"],
|
|
onResolved: (resolved) => {
|
|
if (resolved.includes("node_modules")) {
|
|
return {
|
|
external: true,
|
|
};
|
|
}
|
|
return resolved;
|
|
},
|
|
}),
|
|
],
|
|
onSuccess: "tsc --project tsconfig.declarations.json",
|
|
});
|