Skip to content

Commit 0b575da

Browse files
committed
try fixing build
1 parent 32c213c commit 0b575da

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/api/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const commonParams = {
4747
},
4848
}),
4949
],
50-
treeShaking: false,
50+
inject: [resolve(process.cwd(), "./zod-openapi-patch.js")],
5151
}
5252
esbuild
5353
.build({

src/api/lambda.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
/* eslint-disable */
22

3+
import "zod-openapi/extend";
34
import awsLambdaFastify from "@fastify/aws-lambda";
45
import init from "./index.js";
6+
import {
7+
serializerCompiler,
8+
validatorCompiler,
9+
ZodTypeProvider,
10+
} from "fastify-type-provider-zod";
511

612
const app = await init();
13+
app.setValidatorCompiler(validatorCompiler);
14+
app.setSerializerCompiler(serializerCompiler);
715
const handler = awsLambdaFastify(app, {
816
decorateRequest: false,
917
serializeLambdaArguments: true,

src/api/zod-openapi-patch.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import "zod-openapi/extend";

0 commit comments

Comments
 (0)