rails / webpacker

Use Webpack to manage app-like JavaScript modules in Rails
MIT License
5.31k stars 1.47k forks source link

Remove setting RAILS_ENV from RACK_ENV, NODE_ENV defaults RAILS_ENV #3239

Closed justin808 closed 2 years ago

justin808 commented 2 years ago

Per https://nodejs.dev/learn/nodejs-the-difference-between-development-and-production

Generally, the only value that matters for NODE_ENV is production.

~Given the old code, I suspect that many people ran rake assets:precompile and had the NODE_ENV incorrectly set to 'development' for production builds.~

Actually, for running the rake task to build, https://github.com/rails/webpacker/blob/master/lib/tasks/webpacker/compile.rake#L23 sets the NODE_ENV to production if not set.

guillaumebriday commented 2 years ago

This is great, maybe we should talk about RACK_ENV removal in the upgrade docs?

justin808 commented 2 years ago

This is great, maybe we should talk about RACK_ENV removal in the upgrade docs?

@guillaumebriday where in the docs?