Right now, the best strategy is to use optionalRequire
like this:
We’re doing a lot of work on our JS build systems right now, so there’s a change this will need change in future. If it does, there will be a deprecation message with instructions to upgrade.