-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.client.dev.js
More file actions
46 lines (45 loc) · 1.17 KB
/
webpack.client.dev.js
File metadata and controls
46 lines (45 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const webpack = require('webpack');
module.exports = {
mode: 'development',
entry: ['./src/client/index.tsx', 'webpack-hot-middleware/client?path=/__reload&timeout=2000'],
output: {
filename: 'app.js',
path: __dirname,
publicPath: '/',
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
alias: {
client: path.resolve(__dirname, '../src/client'),
shared: path.resolve(__dirname, '../src/shared'),
},
},
module: {
rules: [
{
test: /\.(js|jsx|ts|tsx)$/,
exclude: /node_modules/,
use: [
'babel-loader',
{
loader: require.resolve('babel-loader'),
options: {
plugins: [require.resolve('react-refresh/babel')],
},
},
],
},
],
},
devtool: 'inline-source-map',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: 'src/client/index.html',
}),
new ReactRefreshWebpackPlugin(),
],
};