Spice or updating Decco was probably the correct answer for you, but many years ago I grew tired of the performance overhead of running a PPX when the percentage of files it actually needed to process was fairly small. Luckily this was early enough in my project that swapping to another solution was manageable.
So I migrated from decco to atdgen, which relies on a weird bucklescript-era generator config, and have been very happy. I’m currently working on a fork to make the process work better on ReScript 11 and plan to post about it on this forum once it’s ready.