-
-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
27 lines (26 loc) · 736 Bytes
/
tsdown.config.ts
File metadata and controls
27 lines (26 loc) · 736 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
import { defineConfig } from "tsdown";
export default defineConfig({
entry: ["src/mod.ts", "src/kv.ts", "src/mq.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",
};
},
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;
},
});