Babel plugin to remove non-essential arguments from invariant() calls in production builds. Current stable version is 1.0.0, first release. It solves a common footgun where minifiers don't remove verbose invariant messages. Alternative to manual optimization; offers pragma and argCount options for custom invariant implementations. Lightweight, no runtime dependencies.
npm install babel-plugin-strip-invariantVerified import paths — ran on the pinned version, not inferred.
Configure Babel to strip the message argument from invariant() calls in production builds.
Ensure the plugin is placed under the 'production' env block in .babelrc or use BABEL_ENV=production.
Manually import or define the custom function in your code.
Reorder invocation so that arguments to keep are at the beginning.
Evaluate if plugin still works with your Babel version; may need fork.
Install and import the 'invariant' package: npm install invariant and add import invariant from 'invariant';
Use string plugin name: 'babel-plugin-strip-invariant'
Use Babel 6 or check if fork exists for Babel 7.
Run npm install --save-dev babel-plugin-strip-invariant
No dependency data recorded yet.