Skip to content

Commit 0c3f1ff

Browse files
committed
Exclude dev tools from the prod website configuration
1 parent 97526af commit 0c3f1ff

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

site/webpack-client.config.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ var isDev = process.env.NODE_ENV !== 'production';
77

88
module.exports = {
99

10-
devtool: 'cheap-eval-source-map',
10+
devtool: isDev ? 'cheap-eval-source-map' : 'source-map',
1111

1212
entry: [
13-
path.join(__dirname, 'client.js'),
13+
path.join(__dirname, 'client.js')
14+
].concat(isDev ? [
1415
'webpack-dev-server/client?http://localhost:8080',
1516
'webpack/hot/only-dev-server'
16-
],
17+
] : []),
1718

1819
output: {
1920
path: '__site__/',
2021
filename: isDev ? '[name].js' : '[name]-[hash].js',
21-
publicPath: '',
22+
publicPath: ''
2223
},
2324

2425
target: 'web',
@@ -35,7 +36,7 @@ module.exports = {
3536
{
3637
test: /\.js$/,
3738
exclude: /node_modules/,
38-
loaders: ['react-hot-loader', 'babel-loader']
39+
loaders: isDev ? ['react-hot-loader', 'babel-loader'] : ['babel-loader']
3940
},
4041
{
4142
test: /\.css$/,

0 commit comments

Comments
 (0)