58 lines
2.0 KiB
TypeScript
58 lines
2.0 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import dts from "vite-plugin-dts";
|
|
|
|
export default defineConfig({
|
|
root: __dirname,
|
|
cacheDir: "../../../../node_modules/.vite/packages/api-saga",
|
|
plugins: [
|
|
dts({
|
|
entryRoot: "src",
|
|
tsconfigPath: "./tsconfig.lib.json",
|
|
insertTypesEntry: true,
|
|
}),
|
|
],
|
|
build: {
|
|
outDir: "./dist",
|
|
emptyOutDir: true,
|
|
reportCompressedSize: true,
|
|
sourcemap: true,
|
|
lib: {
|
|
entry: {
|
|
index: "src/index.ts",
|
|
"orchestrator/orchestrator":
|
|
"src/orchestrator/orchestrator.ts",
|
|
"registry/participant-registry":
|
|
"src/registry/participant-registry.ts",
|
|
"persistence/persistence": "src/persistence/persistence.ts",
|
|
"recovery/recovery": "src/recovery/recovery.ts",
|
|
"idempotency/idempotency": "src/idempotency/idempotency.ts",
|
|
"events/events": "src/events/events.ts",
|
|
"compensation/compensation":
|
|
"src/compensation/compensation.ts",
|
|
"tenant/cross-tenant": "src/tenant/cross-tenant.ts",
|
|
"state/state-machine": "src/state/state-machine.ts",
|
|
"instruments/instruments": "src/instruments/instruments.ts",
|
|
"error-codes/error-codes": "src/error-codes/error-codes.ts",
|
|
"testing/testing": "src/testing/testing.ts",
|
|
},
|
|
formats: ["es"],
|
|
},
|
|
rollupOptions: {
|
|
treeshake: true,
|
|
output: {
|
|
preserveModules: true,
|
|
preserveModulesRoot: "src",
|
|
entryFileNames: "[name].js",
|
|
},
|
|
external: [
|
|
/^@suaveplan\//,
|
|
/^@opentelemetry\//,
|
|
/^node:/,
|
|
/^bun:/,
|
|
"zod",
|
|
"tslib",
|
|
],
|
|
},
|
|
},
|
|
});
|