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,
|
2020-08-08 23:26:39 +03:00
|
|
|
hot: true,
|
2018-12-22 17:20:04 +03:00
|
|
|
},
|
|
|
|
entry: [
|
|
|
|
'webpack-dev-server/client?http://localhost:3000',
|
|
|
|
'webpack/hot/only-dev-server',
|
2020-08-08 23:26:39 +03:00
|
|
|
'./index',
|
2018-12-22 17:20:04 +03:00
|
|
|
],
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, 'dist'),
|
2020-08-08 23:26:39 +03:00
|
|
|
filename: 'bundle.js',
|
2018-12-22 17:20:04 +03:00
|
|
|
},
|
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/,
|
2020-08-08 23:26:39 +03:00
|
|
|
include: [__dirname, path.join(__dirname, '../../src')],
|
2018-12-22 17:20:04 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.css?$/,
|
2020-08-08 22:46:01 +03:00
|
|
|
use: [
|
|
|
|
'style-loader',
|
|
|
|
{
|
|
|
|
loader: 'raw-loader',
|
|
|
|
options: {
|
2020-08-08 23:26:39 +03:00
|
|
|
esModule: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2018-12-22 17:20:04 +03:00
|
|
|
};
|