-
-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathbuild.config.mjs
More file actions
51 lines (50 loc) · 1.2 KB
/
build.config.mjs
File metadata and controls
51 lines (50 loc) · 1.2 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { defineBuildConfig } from "obuild/config";
import { rm } from "node:fs/promises";
import { join } from "node:path";
import pkg from "./package.json" with { type: "json" };
export default defineBuildConfig({
entries: [
{
type: "bundle",
input: [
"src/types.ts",
"src/cli.ts",
"src/static.ts",
"src/log.ts",
"src/tracing.ts",
"src/loader.ts",
...[
"deno",
"bun",
"bunny",
"node",
"cloudflare",
"generic",
"service-worker",
"aws-lambda",
].map((adapter) => `src/adapters/${adapter}.ts`),
],
rolldown: {
external: ["bun", "@cloudflare/workers-types", "aws-lambda"],
plugins: [
pkg.name === "srvx-nightly" && {
name: "nightly-alias",
resolveId(id) {
if (id.startsWith("srvx")) {
return {
id: id.replace("srvx", "srvx-nightly"),
external: true,
};
}
},
},
],
},
},
],
hooks: {
async end(ctx) {
await rm(join(ctx.pkgDir, "dist/types.mjs"));
},
},
});