2018-12-21 22:18:05 +03:00
|
|
|
var path = require('path');
|
|
|
|
var webpack = require('webpack');
|
|
|
|
|
|
|
|
var isProduction = process.env.NODE_ENV === 'production';
|
|
|
|
|
|
|
|
module.exports = {
|
2020-08-01 00:32:41 +03:00
|
|
|
mode: isProduction ? 'production' : 'development',
|
2020-08-01 22:30:39 +03:00
|
|
|
devtool: 'eval-source-map',
|
2018-12-21 22:18:05 +03:00
|
|
|
entry: [
|
|
|
|
!isProduction && 'webpack-dev-server/client?http://localhost:3000',
|
|
|
|
!isProduction && 'webpack/hot/only-dev-server',
|
|
|
|
'./src/index'
|
|
|
|
].filter(Boolean),
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, 'dist'),
|
|
|
|
filename: 'bundle.js',
|
|
|
|
publicPath: '/static/'
|
|
|
|
},
|
2020-08-05 16:12:31 +03:00
|
|
|
plugins: [new webpack.HotModuleReplacementPlugin()],
|
2018-12-21 22:18:05 +03:00
|
|
|
module: {
|
2020-08-01 00:32:41 +03:00
|
|
|
rules: [
|
2019-01-10 21:51:14 +03:00
|
|
|
{
|
|
|
|
test: /\.js$/,
|
2020-08-01 00:32:41 +03:00
|
|
|
loader: 'babel-loader',
|
2019-01-10 21:51:14 +03:00
|
|
|
include: path.join(__dirname, 'src')
|
|
|
|
}
|
|
|
|
]
|
2018-12-21 22:18:05 +03:00
|
|
|
}
|
|
|
|
};
|