forked from firebase/firebase-functions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsdown.config.mts
More file actions
37 lines (35 loc) · 1.02 KB
/
tsdown.config.mts
File metadata and controls
37 lines (35 loc) · 1.02 KB
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
import { defineConfig } from "tsdown";
const rewriteProtoPathMjs = {
name: "rewrite-proto-path-mjs",
resolveId(source) {
if (source === "../../../protos/compiledFirestore") {
return { id: "../../../../protos/compiledFirestore.mjs", external: true };
}
return null;
},
};
// Note: We use tsc (via tsconfig.release.json) for .d.ts generation instead of tsdown's
// built-in dts option due to issues with rolldown-plugin-dts.
// See: https://github.com/sxzz/rolldown-plugin-dts/issues/121
export default defineConfig([
{
entry: "src/**/*.ts",
unbundle: true,
format: "cjs",
outDir: "lib",
clean: true,
dts: false, // Use tsc for type declarations
treeshake: false,
external: ["../../../protos/compiledFirestore"],
},
{
entry: "src/**/*.ts",
unbundle: true,
format: "esm",
outDir: "lib/esm",
clean: false, // Don't clean - need to keep cjs/ output
dts: false, // Use tsc for type declarations
treeshake: false,
plugins: [rewriteProtoPathMjs],
},
]);