HenrikJoreteg / hjs-webpack

Helpers/presets for setting up webpack with hotloading react and ES6(2015) using Babel.
1.79k stars 129 forks source link

Unable to use the production optimization in other environments #328

Closed gjchung closed 7 years ago

gjchung commented 7 years ago

Your lib has been great for getting us up and running fast but we ran into one issue we were hoping we can get your help on.

Our technology stack has several different environment types between local development and production. We'd like to be able to use the production settings in the non-development environments. Can you please add the ability to specify an environment other than "production"?

https://github.com/HenrikJoreteg/hjs-webpack/blob/master/index.js#L155

Thanks! Joycelyn

selbekk commented 7 years ago

Hi, and sorry for the late reply.

Hm, that would indeed be doable. Right now, we decide whether or not we're in production by checking if we're running hjs-dev-server.

A possible solution could be to use the NODE_ENV environment variable if set, and default to production if it's not. This shouldn't be a breaking change either.

gjchung commented 7 years ago

Thanks putting in this change!