2016-05-03 06:09:16 +02:00
|
|
|
var webpack = require('webpack');
|
2016-07-21 01:48:00 +02:00
|
|
|
require('dotenv').config();
|
2016-05-03 06:09:16 +02:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
devtool: 'cheap-module-eval-source-map',
|
2016-11-09 00:11:12 +01:00
|
|
|
entry: {
|
|
|
|
app: ['babel-polyfill',
|
|
|
|
'webpack-hot-middleware/client',
|
2016-11-09 00:54:54 +01:00
|
|
|
'./client/index.jsx',
|
2016-11-09 00:11:12 +01:00
|
|
|
],
|
|
|
|
vendor: [
|
|
|
|
'react',
|
|
|
|
'react-dom'
|
|
|
|
]
|
|
|
|
},
|
2016-05-03 06:09:16 +02:00
|
|
|
output: {
|
|
|
|
path: __dirname + '/dist/',
|
2016-11-09 00:11:12 +01:00
|
|
|
filename: 'app.js',
|
2016-05-03 06:09:16 +02:00
|
|
|
publicPath: '/dist/'
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['', '.js', '.jsx'],
|
2016-11-09 00:11:12 +01:00
|
|
|
modules: [
|
|
|
|
'client',
|
2016-11-16 19:12:36 +01:00
|
|
|
'node_modules'
|
2016-11-09 00:11:12 +01:00
|
|
|
]
|
2016-05-03 06:09:16 +02:00
|
|
|
},
|
|
|
|
plugins: [
|
2016-06-23 00:36:04 +02:00
|
|
|
new webpack.HotModuleReplacementPlugin(),
|
2016-11-09 00:11:12 +01:00
|
|
|
new webpack.optimize.CommonsChunkPlugin({
|
|
|
|
name: 'vendor',
|
|
|
|
minChunks: Infinity,
|
|
|
|
filename: 'vendor.js',
|
|
|
|
}),
|
2016-06-23 00:36:04 +02:00
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env': {
|
|
|
|
CLIENT: JSON.stringify(true),
|
|
|
|
'NODE_ENV': JSON.stringify('development'),
|
2016-07-21 01:48:00 +02:00
|
|
|
'S3_BUCKET': '"' + process.env.S3_BUCKET + '"'
|
2016-06-23 00:36:04 +02:00
|
|
|
}
|
|
|
|
})
|
2016-05-03 06:09:16 +02:00
|
|
|
],
|
|
|
|
module: {
|
|
|
|
loaders: [
|
|
|
|
{
|
2016-06-27 23:40:16 +02:00
|
|
|
test: /\.jsx?$/,
|
2016-05-03 06:09:16 +02:00
|
|
|
exclude: [/node_modules/, /.+\.config.js/],
|
2016-07-22 19:14:26 +02:00
|
|
|
loaders: ['babel', 'eslint-loader']
|
2016-05-03 06:09:16 +02:00
|
|
|
},
|
2016-05-03 22:13:04 +02:00
|
|
|
{
|
2016-05-10 20:18:36 +02:00
|
|
|
test: /\.scss$/,
|
|
|
|
loaders: ['style', 'css', 'sass']
|
2016-05-11 19:19:37 +02:00
|
|
|
},
|
|
|
|
{
|
2016-08-15 17:51:11 +02:00
|
|
|
test: /\.(svg|mp3)$/,
|
2016-05-11 19:19:37 +02:00
|
|
|
loader: 'file'
|
2016-08-18 20:22:47 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /fonts\/.*\.(eot|svg|ttf|woff|woff2)$/,
|
|
|
|
loader: 'file'
|
2016-05-03 22:13:04 +02:00
|
|
|
}
|
2016-05-03 06:09:16 +02:00
|
|
|
],
|
|
|
|
},
|
2016-08-11 19:24:02 +02:00
|
|
|
};
|