forked from akash-network/console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
31 lines (28 loc) · 1.2 KB
/
tsup.config.ts
File metadata and controls
31 lines (28 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { applyDefaults, copyDrizzlePlugin } from "@akashnetwork/dev-config/tsup-plugins.ts";
import { fileURLToPath } from "node:url";
import { defineConfig } from "tsup";
import packageJson from "./package.json";
import tsconfig from "./tsconfig.build.json";
const isProduction = process.env.NODE_ENV === "production";
export default defineConfig(async overrideOptions =>
applyDefaults({
packageJson,
// this is to ensure that this modules are loaded before the entry point,
// even if tsup messes up imports tree
prependEffectsToEntries: ["reflect-metadata", "@akashnetwork/env-loader"],
entry: {
server: "./src/server.ts",
"rest-app": "./src/rest-app.ts",
"background-jobs-app": "./src/background-jobs-app.ts",
console: "./src/console.ts",
instrumentation: fileURLToPath(import.meta.resolve("@akashnetwork/instrumentation/register"))
},
target: tsconfig.compilerOptions.target,
tsconfig: "tsconfig.build.json",
external: ["pino-pretty"],
dts: false,
plugins: [...(isProduction ? [copyDrizzlePlugin] : [])],
onSuccess: overrideOptions.watch && !isProduction ? "node --enable-source-maps dist/server.js" : undefined,
...overrideOptions
})
);