forked from fedify-dev/fedify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
41 lines (40 loc) · 1015 Bytes
/
Copy pathtsdown.config.ts
File metadata and controls
41 lines (40 loc) · 1015 Bytes
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
32
33
34
35
36
37
38
39
40
41
import { defineConfig } from "tsdown";
export default defineConfig({
entry: [
"src/mod.ts",
"src/kv.ts",
"src/mq.ts",
"src/sqlite.node.ts",
"src/sqlite.bun.ts",
],
dts: { compilerOptions: { isolatedDeclarations: true, declaration: true } },
unbundle: true,
format: ["esm", "cjs"],
platform: "node",
outExtensions({ format }) {
return {
js: format === "cjs" ? ".cjs" : ".js",
dts: format === "cjs" ? ".d.cts" : ".d.ts",
};
},
inputOptions: {
onwarn(warning, defaultHandler) {
if (
warning.code === "UNRESOLVED_IMPORT" &&
["#sqlite", "bun:sqlite"].includes(warning.exporter ?? "")
) {
return;
}
defaultHandler(warning);
},
},
banner({ format }) {
const js = format === "cjs"
? `const { Temporal } = require("@js-temporal/polyfill");`
: `import { Temporal } from "@js-temporal/polyfill";`;
return {
js,
dts: `/// <reference lib="esnext.temporal" />`,
};
},
});