Skip to content

Commit

Permalink
docs: clarification standalone requirements (#1738)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eomm authored Sep 12, 2021
1 parent a9f38cd commit 87d1901
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/standalone.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ const requireFromString = require("require-from-string")
const standaloneValidate = requireFromString(moduleCode) // for a single default export
```

Ajv package should still be a run-time dependency for most schemas, but generated modules can only depend on code in [runtime](https://github.com/ajv-validator/ajv/tree/master/lib/runtime) folder, so the whole Ajv will not be included in the bundle (or executed) if you require the modules with standalone validation code from your application code.
### Requirement at runtime

To run the standalone generated functions, the Ajv package should still be a run-time dependency for most schemas, but generated modules can only depend on code in [runtime](https://github.com/ajv-validator/ajv/tree/master/lib/runtime) folder, so the whole Ajv will not be included in the bundle (or executed) if you require the modules with standalone validation code from your application code.

## Configuration and limitations

Expand Down

0 comments on commit 87d1901

Please sign in to comment.