// http://www.jonathan-petitcolas.com/2015/05/15/howto-setup-webpack-on-es6-react-application-with-sass.html var ExtractTextPlugin = require('extract-text-webpack-plugin'); function getEntrySources() { var sources = [ './js/index.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', loader: 'babel', query: { presets: ['react', 'es2015'] } }, { test: /\.scss$/, include: __dirname + '/sass', loader: ExtractTextPlugin.extract('css!sass') } ] }, output: { path: __dirname, filename: 'bundle.js' }, plugins: [ new ExtractTextPlugin('style.css', { allChunks: true }) ] };