How to run Meteor with React production mode?

How do you run your Meteor application with React in “production” mode?

Just checked and we are still in “development” mode on Galaxy, which we thought was fixed in Meteor 1.5.1 with this Pull Request. Browser is returning the correct value of production when running the console command process.env.NODE_ENV so not sure what is wrong. We are running Meteor 1.5.2-beta.8.

Also checked development machine and returns development and when running with --production flag correctly returns production.

@hwillson Any thoughts?

1 Like

Are you using Material-UI or other 3rd party libs? After some further experimentation it possibly looks like Meteor is not transforming components from node_modules during minification process. We are going to test with a simple react-todos app.

Yes, we’re using https://ant.design/ UI library. It would be great if someone resolve this issue.

Did you try the Meteor uglify-js plugin? It worked for us

Thank you, @XTA! This is good solution!