// http://www.jonathan-petitcolas.com/2015/05/15/howto-setup-webpack-on-es6-react-application-with-sass.html function getEntrySources() { var sources = [ './js/main.js' ]; if (process.env.NODE_ENV !== 'production') { sources.push('webpack-dev-server/client?http://localhost:8080'); sources.push('webpack/hot/only-dev-server'); } return sources; } module.exports = { entry: getEntrySources(), module: { loaders: [ { test: /\.js$/, include: __dirname + '/js', loaders: ['react-hot', 'babel'] } ] }, output: { path: __dirname, filename: 'bundle.js' } };