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',
|
2020-08-08 23:26:39 +03:00
|
|
|
'./src/index',
|
2018-12-21 22:18:05 +03:00
|
|
|
].filter(Boolean),
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, 'dist'),
|
|
|
|
filename: 'bundle.js',
|
2020-08-08 23:26:39 +03:00
|
|
|
publicPath: '/static/',
|
2018-12-21 22:18:05 +03:00
|
|
|
},
|
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',
|
2020-08-08 23:26:39 +03:00
|
|
|
include: path.join(__dirname, 'src'),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-08-09 08:06:18 +03:00
|
|
|
devServer: {
|
|
|
|
historyApiFallback: true,
|
|
|
|
hot: true,
|
|
|
|
port: 3000,
|
|
|
|
},
|
2018-12-21 22:18:05 +03:00
|
|
|
};
|