( opts?: PrecompilePluginOptions )
| 51 | NodeHostOptions {} |
| 52 | |
| 53 | export const createPrecompiler = ( |
| 54 | opts?: PrecompilePluginOptions |
| 55 | ): Precompiler => { |
| 56 | const cwd = realPathOf(opts?.cwd ?? process.cwd()) |
| 57 | // a key matching no file would choose for nothing. Read here, where a |
| 58 | // build first asks of a module, as only then is cwd the bundler's root |
| 59 | if (opts?.runtime !== "arktype") |
| 60 | new SchemaStrategies(opts ?? {}, "speed", cwd).checkFiles() |
| 61 | return new Precompiler(createNodeHost(opts), { |
| 62 | ...opts, |
| 63 | cwd, |
| 64 | config: |
| 65 | typeof opts?.config === "string" ? |
| 66 | realPathOf(resolve(cwd, opts.config)) |
| 67 | : opts?.config |
| 68 | }) |
| 69 | } |
| 70 | |
| 71 | export interface RenderedDiagnostics { |
| 72 | errors: string[] |
no test coverage detected