You can see an example of usage in a BuckleScript project in this folder.
The most relevant point is the ppx-flags
in bsconfig.json
, that is pointing to the ppx executable:
"ppx-flags": [
"esy x ppx_42"
],
To install and build the ppx binary so it is available to bsb (BuckleScript build tool) in the the example app:
$ esy
Then you can run:
$ yarn build
or
$ npm build
At that point, you should see the file src/Index.bs.js
with the following output:
// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE
'use strict';
var fourtyTwo = String(42);
console.log(fourtyTwo);
exports.fourtyTwo = fourtyTwo;
/* fourtyTwo Not a pure module */