Babel plugin that rewrites invariant calls with their source location
Перейти к файлу
Mislav Marohnić 1f92b264e1 1.0.1 2019-05-29 20:08:39 +02:00
LICENSE Create LICENSE 2018-01-04 13:57:17 +01:00
README.md Create README.md 2018-01-04 14:09:45 +01:00
index.js Fix obtaining name of currently processed file 2019-05-29 20:07:20 +02:00
package-lock.json 1.0.1 2019-05-29 20:08:39 +02:00
package.json 1.0.1 2019-05-29 20:08:39 +02:00

README.md

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")