2

I'm getting

You are currently using minified code outside of NODE_ENV === 'production'. This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) to ensure you have the correct code for your production build.

I tried to fix it by adding following codes to my webpack config. But it didn't work for Redux. However, following codes did fix a similar warning from React.

plugins: [
  ...
  new webpack.DefinePlugin({
    'process.env': {
      'NODE_ENV': '"production"'
    }
  }),
  ...

Did I miss anything?

zachguo
  • 6,200
  • 5
  • 30
  • 31

1 Answers1

1

Got it work after some trial and error

plugins: [
    new webpack.DefinePlugin({
        'process.env': {
            'NODE_ENV': '"production"'
        }
    })
]

Then in my package.json I run npm script "build:webpack" which does the following

"build:webpack": "webpack -p --define process.env.NODE_ENV='\"production\"'"
s_ferdie
  • 56
  • 4