var path = require('path'); var autoprefixer = require('autoprefixer'); var webpack = require('webpack'); var HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { devtool: 'source-map', entry: './src/index.js', output: { // Next line is not used in dev but WebpackDevServer crashes without it: path: path.join(__dirname, 'build'), filename: 'bundle.js', publicPath: '/' }, module: { loaders: [ { test: /\.css$/, include: path.resolve(__dirname, 'src'), loader: 'style!css!postcss' }, { test: /\.js$/, include: path.resolve(__dirname, 'src'), loader: 'babel' } ] }, postcss: function () { return [ autoprefixer ]; }, plugins: [ // TODO: infer from package.json? new HtmlWebpackPlugin({ title: 'My React Project' }), new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"development"' }) ] };