diff --git a/webpack.config.js b/webpack.config.js index a91ac44..12ce333 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,11 +1,13 @@ 'use strict'; +const ENV = process.env.NODE_ENV; + const webpack = require('webpack'); const path = require('path'); const autoprefixer = require('autoprefixer'); module.exports = { - devtool: 'eval-source-map', + devtool: ENV === 'production' ? 'source-map' : 'eval-source-map', entry: [ 'webpack-hot-middleware/client?reload=true', path.join(__dirname, 'client/index.js'), @@ -48,7 +50,7 @@ module.exports = { new webpack.HotModuleReplacementPlugin(), new webpack.DefinePlugin({ 'process.env': { - 'NODE_ENV': JSON.stringify(process.env.NODE_ENV), + 'NODE_ENV': JSON.stringify(ENV), }, }), ],