React displayName on production is minified, how to turn off?

Is there a configuration option to turn off minifying the displayName of components?

When I develop my app, nothing gets minified, and when I use React Dev Tools, I can easily see what components are where.

But when I push it out to production, all the code gets minified and React Dev Tools instead shows <e ...> or Container(e), which isn’t very helpful.

I’m fixing this by manually setting the displayName on each component. Once I’ve done it for all of them, it will be easier, but currently it’s tedious. It also seems like something that could be configured, which would be nice.

Typically, minification is done using uglifyjs. IIRC, it offers an option to exclude certain names from minification.

Can it be configured to exclude all component names?

From the sound of it, I’d have to configure it for each and every component, which is just as bad as my current solution.

I can just guess that React uses a common key for the displayName, maybe it’s just displayName.

How do I configure the minification in Meteor? Do you have a link to a guide?

Oh sorry, I totally forgot that this is about Meteor. I’m using Webpack too much these days…

I looked into the standard-minifier-js package. That’s just a simple wrapper for the NPM package. So it’s fairly easy to do a fork, apply the settings and use this package instead of the default one.

Ah okay, so there doesn’t seem to be a way to configure this directly in Meteor. Thank you. I wanted to verify that before starting an issue or pull request

Not sure, but I don’t think this is configurable by default. If you look at the package’s JS code, this is really just a small wrapper around the NPM package.