This can be done either via babel-macros (would work with CRA out of the box, might be harder) or with babel transforms (might be easier).