Skip to content

Commit

Permalink
Add source-map devtool in production
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mironchik committed Jul 24, 2016
1 parent c5f514e commit 9b10981
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -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'),
Expand Down Expand Up @@ -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),
},
}),
],
Expand Down

0 comments on commit 9b10981

Please sign in to comment.