| 24 | |
| 25 | // ajv's standalone code, which needs no compiler at runtime |
| 26 | const ajvModule = async (scenario: SizedScenario) => { |
| 27 | const schemas: Record<string, object> = await import( |
| 28 | join(apps, scenario, "ajv.ts") |
| 29 | ) |
| 30 | const ajv = ajvOf({ |
| 31 | schemas: Object.values(schemas), |
| 32 | code: { |
| 33 | source: true, |
| 34 | esm: true, |
| 35 | formats: _`require("ajv-formats/dist/formats").fullFormats` |
| 36 | } |
| 37 | }) |
| 38 | return standaloneCode.default( |
| 39 | ajv, |
| 40 | Object.fromEntries(Object.keys(schemas).map(name => [name, name])) |
| 41 | ) |
| 42 | } |
| 43 | |
| 44 | // sized only: arktype precompiled with the "smallest" preset. Every bundle is |
| 45 | // a production build (esbuild's "production" condition), which prunes a |