If you use the invariant
library, then this rollup plugin is the plugin for you!
This transforms any invariant()
callsite to the native throw
equivalent:
// Before
invariant(foo, "Foo isnt available!")
// After
if (!(foo)) { throw new Error("invariant: Foo isnt available!"); }