- Create a dune file:
(library
(public_name aggregate_ppx_name)
(kind ppx_rewriter)
(libraries ppx_deriving_protobuf other_ppx another_ppx))
- Build:
dune build --profile release
- Create a script (I called it ppx.exe) in the same directory as
bsconfig.json
. It'll containt all rewriters listed under libraries above:
./_build/install/default/lib/aggregate_ppx_name/ppx.exe --as-ppx "$@"
- Add your
./ppx.exe
to bsconfig.json
"ppx-flags": ["./ppx.exe"],
Note: the commands/paths are slightly different if you use esy.