Skip to content

Commit c21d5e2

Browse files
committed
Ref: static import in tsdown.config for the framework workspace.
1 parent 1dd79b8 commit c21d5e2

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

express-zod-api/tsdown.config.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { defineConfig } from "tsdown";
2-
import { readFile } from "node:fs/promises";
3-
4-
const { version } = JSON.parse(await readFile("./package.json", "utf8"));
2+
import manifest from "./package.json" with { type: "json" };
53

64
export default defineConfig({
75
entry: "src/index.ts",
86
minify: true,
97
attw: { profile: "esmOnly", level: "error" },
108
define: {
11-
"process.env.TSDOWN_BUILD": `"v${version}"`, // @since v25.0.0 is pure ESM
9+
"process.env.TSDOWN_BUILD": `"v${manifest.version}"`, // @since v25.0.0 is pure ESM
1210
"process.env.TSDOWN_STATIC": `"static"`, // used by isProduction()
1311
},
1412
});

0 commit comments

Comments
 (0)