Skip to content

Development react.js and production react.js are identical in react-rails 1.4.0 gem #379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Chehai opened this issue Oct 23, 2015 · 7 comments

Comments

@Chehai
Copy link

Chehai commented Oct 23, 2015

In react-rails 1.3.3, production react.js is minified while development react.js is not minified.

@rmosolgo
Copy link
Member

I thought I'd let people minify it with Sprockets / asset pipeline. Is that a bad option for your case?

@Chehai
Copy link
Author

Chehai commented Oct 23, 2015

Well, the real problem is that after asset compilation in production react.js is still in development mode, because Rails asset pipeline does not set process.env.NODE_ENV to be production.

@rmosolgo
Copy link
Member

Oh! I thought this was enough, but I guess it wasn't:

https://github.com/reactjs/react-rails/blob/master/react-builds/webpack.config.js#L23

I'll have to dig deeper in to figure that out

@Chehai
Copy link
Author

Chehai commented Oct 23, 2015

Thanks for looking at it!

React-rails 1.3.3 drops a minified react.js without any process.env.NODE_ENV in code to Rails asset pipeline. 1.4.4 drops a un-minified react.js with process.env.NODE_ENV everywhere in code to the pipeline.

@rmosolgo
Copy link
Member

🎊 #380

@rmosolgo
Copy link
Member

Shipped in 1.4.1, thanks for the report and let me know how that one goes for you!

@Chehai
Copy link
Author

Chehai commented Oct 24, 2015

Thanks for fixing it! 1.4.1 works well for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants