Once prepack becomes more stable, and has support for `require`, perhaps use it to help generate the package's file https://prepack.io/