-
-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
38 lines (37 loc) · 927 Bytes
/
tsdown.config.ts
File metadata and controls
38 lines (37 loc) · 927 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
import { defineConfig } from "tsdown";
export default defineConfig({
entry: ["src/mod.tsx"],
dts: { compilerOptions: { isolatedDeclarations: true, declaration: true } },
format: ["esm", "cjs"],
platform: "node",
outExtensions({ format }) {
return {
js: format === "cjs" ? ".cjs" : ".js",
dts: format === "cjs" ? ".d.cts" : ".d.ts",
};
},
deps: {
neverBundle: [
"@fedify/fedify",
"@fedify/fedify/federation",
"@fedify/fedify/otel",
"@logtape/logtape",
/^@logtape\//,
/^@opentelemetry\//,
"hono",
/^hono\//,
],
},
outputOptions(outputOptions, format) {
if (format === "cjs") {
outputOptions.intro = `
const { Temporal } = require("@js-temporal/polyfill");
`;
} else {
outputOptions.intro = `
import { Temporal } from "@js-temporal/polyfill";
`;
}
return outputOptions;
},
});