1.0.1 • Published 5 years ago

babel-plugin-transform-invariant-location v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

transform-invariant-location

A Babel plugin to annotate Flow invariant() calls with an additional string argument detailing the current file and line number. This is useful to track down exceptions that are raised by invariant() in minified bundles at runtime.

Before:

invariant(foo)
invariant(foo, "foo is missing")

After:

invariant(foo, "path/to/source.js:42")
invariant(foo, "foo is missing -- path/to/source.js:42")