React-hot-loader: REACT_HOT_LOADER in production build

Created on 19 Sep 2016  Â·  2Comments  Â·  Source: gaearon/react-hot-loader

I see a lot of churn in our production build having to do with areas like this:

(function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(set, 'set', '/Users/username/…');

  __REACT_HOT_LOADER__.register(_default, 'default', '/Users/username/…');
})();

Depending on who builds from what machine, that /Users/user bit changes all the time. Is there some way that I'm missing to exclude that from production builds?

Most helpful comment

Ugh, yeah. Thanks for the tip.

Don't:
webpack --define process.env.NODE_ENV='\"production\"'

Do:
NODE_ENV=production webpack

All 2 comments

See #357, make sure you have process.env.NODE_ENV set to production during the build.

Ugh, yeah. Thanks for the tip.

Don't:
webpack --define process.env.NODE_ENV='\"production\"'

Do:
NODE_ENV=production webpack

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JamesIves picture JamesIves  Â·  4Comments

tiberiumaxim picture tiberiumaxim  Â·  4Comments

mattkrick picture mattkrick  Â·  3Comments

ghost picture ghost  Â·  3Comments

theKashey picture theKashey  Â·  3Comments