mirror of
https://github.com/github/babel-plugin-transform-invariant-location
synced 2026-07-21 03:43:46 +00:00
No description
- JavaScript 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| index.js | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| 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")