Created
November 26, 2015 13:57
-
-
Save eiriklv/371acbbfb5d0034aa1d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
var isProduction = process.env.NODE_ENV == 'production'; | |
var plugins = []; | |
if (isProduction) { | |
plugins.push(new webpack.optimize.UglifyJsPlugin()) | |
} | |
module.exports = { | |
devtool: !isProduction ? 'inline-source-maps' : 'source-map', | |
entry: !isProduction ? [ | |
'webpack-dev-server/client?http://localhost:3000', | |
'webpack/hot/only-dev-server', | |
'./src/entry.js' | |
] : ['./src/entry.js'], | |
output: { | |
path: __dirname + '/public/', | |
publicPath: '/', | |
filename: 'bundle.js' | |
}, | |
plugins: plugins, | |
module: { | |
loaders: [{ | |
test: /\.jsx?$/, | |
loaders: isProduction ? ['babel'] : ['react-hot', 'babel'], | |
exclude: /node_modules/, | |
}, { | |
test: /\.scss$/, | |
loaders: ['style', 'css', 'autoprefixer', 'sass'] | |
}] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment