Babel plugin that optimizes calls to `obj-str` by replacing them with equivalent unrolled string concatenation, resulting in ~1.8x performance improvement. Version 1.1.0 includes TypeScript definitions. Maintained by the same author as the `obj-str` library. Key differentiator: unlike other classname utilities, this plugin performs static analysis to inline only optimizable calls, preserving others by default. Released under MIT license.
npm install babel-plugin-optimize-objstrVerified import paths — ran on the pinned version, not inferred.
Configures Babel to replace obj-str calls with optimized string concatenation for performance gains.
The leading space is intentional; most consumers like className work fine with it.
Avoid duplicate keys in obj-str calls, or use a consistent condition for duplicate keys.
Consider the trade-off; for large number of properties, using obj-str directly may be smaller.
Use strict mode only if you have full control over all obj-str calls and want to enforce optimization.
npm install --save-dev babel-plugin-optimize-obj-str
Ensure the first argument to objstr() is an object literal with string literal keys. Non-optimizable calls are preserved by default.
No dependency data recorded yet.