rollup-plugin-inline-invariant

Stars
6
Committers
1

rollup-plugin-inline-invairant

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!"); }