webpack.config.dev.js
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'eval-source-map',
entry: {
root: [
'babel-polyfill',
'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000',
'./docs/root'
]
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js',
publicPath: '/static/'
},
resolve: {
extensions: ['.js']
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development')
}
}),
new HtmlWebpackPlugin({
inject: false,
template: 'docs/index.ejs',
title: 'react-poppop'
})
],
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}
]
}
}