Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

Babel plugin that rewrites invariant calls with their source location

License

Notifications You must be signed in to change notification settings

github/babel-plugin-transform-invariant-location

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Babel plugin that rewrites invariant calls with their source location

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages