2016-12-22 04:54:22 +00:00
|
|
|
var path = require('path');
|
|
|
|
var webpack = require('webpack');
|
|
|
|
|
|
|
|
module.exports = {
|
2016-12-30 07:21:38 +00:00
|
|
|
devtool: 'cheap-module-source-map',
|
2016-12-22 04:54:22 +00:00
|
|
|
entry: [
|
|
|
|
'./src/index'
|
|
|
|
],
|
|
|
|
output: {
|
2016-12-28 08:50:58 +00:00
|
|
|
path: path.join(__dirname, 'public'),
|
2016-12-22 04:54:22 +00:00
|
|
|
filename: 'bundle.js',
|
2016-12-28 08:50:58 +00:00
|
|
|
publicPath: ''
|
2016-12-22 04:54:22 +00:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.HotModuleReplacementPlugin(),
|
2016-12-30 07:21:38 +00:00
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env': {
|
|
|
|
'NODE_ENV': JSON.stringify('production')
|
|
|
|
}
|
|
|
|
}),
|
2017-01-09 22:53:02 +00:00
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
|
|
compress: {
|
|
|
|
warnings: false
|
|
|
|
}
|
|
|
|
}),
|
2016-12-22 04:54:22 +00:00
|
|
|
new webpack.NoErrorsPlugin()
|
|
|
|
],
|
|
|
|
module: {
|
|
|
|
loaders: [{
|
|
|
|
test: /\.js$/,
|
2017-01-09 22:53:02 +00:00
|
|
|
loaders: ['babel-loader'],
|
2016-12-22 04:54:22 +00:00
|
|
|
include: path.join(__dirname, 'src')
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
};
|