2020-08-05 15:42:25 +03:00
|
|
|
var path = require('path');
|
|
|
|
var webpack = require('webpack');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
|
|
|
|
devtool: 'eval-source-map',
|
|
|
|
entry: [
|
|
|
|
'webpack-dev-server/client?http://localhost:3000',
|
|
|
|
'webpack/hot/only-dev-server',
|
2020-08-08 23:26:39 +03:00
|
|
|
'./index',
|
2020-08-05 15:42:25 +03:00
|
|
|
],
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, 'dist'),
|
|
|
|
filename: 'bundle.js',
|
2020-08-08 23:26:39 +03:00
|
|
|
publicPath: '/static/',
|
2020-08-05 15:42:25 +03:00
|
|
|
},
|
2020-08-05 16:12:31 +03:00
|
|
|
plugins: [new webpack.HotModuleReplacementPlugin()],
|
2020-08-05 15:42:25 +03:00
|
|
|
resolve: {
|
2020-08-08 23:26:39 +03:00
|
|
|
extensions: ['.js'],
|
2020-08-05 15:42:25 +03:00
|
|
|
},
|
|
|
|
module: {
|
2020-08-05 16:12:31 +03:00
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
loaders: ['babel-loader'],
|
|
|
|
exclude: /node_modules/,
|
2020-08-08 23:26:39 +03:00
|
|
|
include: __dirname,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-08-09 08:06:18 +03:00
|
|
|
devServer: {
|
|
|
|
historyApiFallback: true,
|
|
|
|
hot: true,
|
|
|
|
port: 3000,
|
|
|
|
},
|
2020-08-05 15:42:25 +03:00
|
|
|
};
|