const path = require('path');
const webpack = require('webpack');
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-hot-middleware/client',
'babel-polyfill',
path.join(__dirname, '../../app/web/index'),
],
output: {
path: path.join(__dirname, '../public'),
filename: 'bundle.js',
publicPath: '/',
},
module: {
loaders: [
{
test: /\.less$/,
loader: 'style!css?sourceMap!less?sourceMap',
}, {
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react'],
plugins: [['react-transform', {
transforms: [{
transform: 'react-transform-hmr',
imports: ['react'],
// this is important for Webpack HMR:
locals: ['module']
}],
}]],
},
}, {
test: /\.json$/,
loader: 'json',
},
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development'),
PLATFORM_ENV: JSON.stringify('web'),
},
}),
new webpack.optimize.OccurenceOrderPlugin(),
// new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
],
};