2015-12-28 23:34:32 +00:00
|
|
|
var path = require('path');
|
|
|
|
var webpack = require('webpack');
|
|
|
|
|
2017-06-21 06:40:28 +00:00
|
|
|
function dir(p) {
|
|
|
|
return path.resolve(__dirname, p);
|
|
|
|
}
|
|
|
|
|
|
|
|
function jsDir(p) {
|
|
|
|
return path.resolve(__dirname, 'src/js', p);
|
|
|
|
}
|
|
|
|
|
2015-12-28 23:34:32 +00:00
|
|
|
module.exports = {
|
|
|
|
devtool: 'eval',
|
|
|
|
entry: [
|
2017-04-11 22:00:59 +00:00
|
|
|
'react-hot-loader/patch',
|
2015-12-28 23:34:32 +00:00
|
|
|
'webpack-hot-middleware/client',
|
|
|
|
'./src/js/index'
|
|
|
|
],
|
|
|
|
output: {
|
2017-06-21 06:40:28 +00:00
|
|
|
path: dir('dist'),
|
2015-12-28 23:34:32 +00:00
|
|
|
filename: 'bundle.js',
|
|
|
|
publicPath: '/'
|
|
|
|
},
|
2017-06-21 06:40:28 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
components: jsDir('components'),
|
|
|
|
containers: jsDir('containers'),
|
|
|
|
state: jsDir('state'),
|
|
|
|
util: jsDir('util')
|
|
|
|
}
|
|
|
|
},
|
2015-12-28 23:34:32 +00:00
|
|
|
module: {
|
2017-02-16 02:55:50 +00:00
|
|
|
rules: [
|
|
|
|
{ test: /\.js$/, loader: 'eslint-loader', exclude: /node_modules/, enforce: 'pre' },
|
|
|
|
{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ },
|
2017-04-12 01:38:02 +00:00
|
|
|
{ test: /\.css$/, loader: 'style-loader!css-loader' }
|
2015-12-28 23:34:32 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
2017-02-16 02:55:50 +00:00
|
|
|
DEV: true,
|
2015-12-28 23:34:32 +00:00
|
|
|
}),
|
|
|
|
new webpack.HotModuleReplacementPlugin(),
|
2017-03-28 21:18:55 +00:00
|
|
|
new webpack.NoEmitOnErrorsPlugin()
|
2015-12-28 23:34:32 +00:00
|
|
|
]
|
|
|
|
};
|