babel-plugin-strip-object-freeze
Replace all instances of
Object.freeze(value)
withvalue
If you use Object.freeze()
a lot in development to enforce constraints, you
may want to use this plugin to strip those Object.freeze()
calls in production
for performance if they are not important.
Install
npm install --save-dev babel-plugin-strip-object-freeze
Usage
It's recommended that you only use this plugin in a production build.
// babel.config.jslet presets = ... let plugins = ... if processenvNODE_ENV === "production" plugins moduleexports = presets plugins
Example
Input:
Object
Output:
value