I've created a basic app and deployed it for production. After running webpack -p and starting the server, I am now getting this console log error:
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.
Here is my webpack.config.js file:
module.exports = {
entry: [
'./src/index.js'
],
output: {
path: __dirname,
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [{
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-1']
}
}]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devServer: {
historyApiFallback: true,
contentBase: './'
}
};
Am very new to React and Webpack especially. If anyone could kindly point out what's wrong and help me wrap my head around webpack (which is very confusing) then it would be forever thankful!
EDIT:
I added the webpack plugin and ran NODE_ENV=production webpack -p
and got this error in terminal:
/Users/Joseph/workspace/weather-fcc/webpack.config.js:27
new webpack.DefinePlugin({
^
ReferenceError: webpack is not defined
at Object.<anonymous> (/Users/Joseph/workspace/weather-fcc/webpack.config.js:27:9)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at requireConfig (/usr/local/lib/node_modules/webpack/bin/convert-argv.js:96:18)
at /usr/local/lib/node_modules/webpack/bin/convert-argv.js:109:17` FWIW my webpack version is 1.12.9