-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
18 lines (16 loc) · 765 Bytes
/
Copy pathtsup.config.ts
File metadata and controls
18 lines (16 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { readFileSync } from "node:fs";
import { defineConfig } from "tsup";
// Read the package version so the reactive runtime can stamp it onto the
// duplicate-instance registry (see src/reactivity/track.ts). `__SIBU_VERSION__`
// is a bundler define — under raw ESM / the test runner it is undefined and the
// runtime falls back to "dev". This config is auto-loaded by every `tsup`
// invocation in the build script (main + CDN), so the stamp lands in all
// outputs. Entry points / formats stay on the CLI; this only adds `define`.
const { version } = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8")) as {
version: string;
};
export default defineConfig({
define: {
__SIBU_VERSION__: JSON.stringify(version),
},
});