2018-12-22 17:20:04 +03:00
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
|
|
|
|
|
|
|
module.exports = {
|
2020-08-01 22:30:39 +03:00
|
|
|
devtool: 'eval-source-map',
|
2018-12-22 17:20:04 +03:00
|
|
|
devServer: {
|
|
|
|
contentBase: path.join(__dirname, 'dist'),
|
|
|
|
host: 'localhost',
|
|
|
|
port: process.env.PORT || 3000,
|
|
|
|
historyApiFallback: true,
|
|
|
|
hot: true
|
|
|
|
},
|
|
|
|
entry: [
|
|
|
|
'react-hot-loader/patch',
|
|
|
|
'webpack-dev-server/client?http://localhost:3000',
|
|
|
|
'webpack/hot/only-dev-server',
|
|
|
|
'./index'
|
|
|
|
],
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, 'dist'),
|
|
|
|
filename: 'bundle.js'
|
|
|
|
},
|
2020-08-05 16:12:31 +03:00
|
|
|
plugins: [new webpack.HotModuleReplacementPlugin()],
|
2018-12-22 17:20:04 +03:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
use: ['babel-loader'],
|
|
|
|
exclude: /node_modules/,
|
|
|
|
include: [__dirname, path.join(__dirname, '../../src')]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.css?$/,
|
2020-08-08 22:46:01 +03:00
|
|
|
use: [
|
|
|
|
'style-loader',
|
|
|
|
{
|
|
|
|
loader: 'raw-loader',
|
|
|
|
options: {
|
|
|
|
esModule: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2018-12-22 17:20:04 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|