-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.cjs
49 lines (48 loc) · 1.04 KB
/
webpack.config.cjs
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
47
48
49
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
module.exports = {
mode: 'development',
entry: './src/index.tsx',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/pokemon-react-app/',
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
},
module: {
rules: [
{
test: /\.tsx?$/,
use: {
loader: 'babel-loader',
options: {
plugins: ['react-refresh/babel'],
},
},
exclude: /node_modules/,
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
],
},
devServer: {
static: {
directory: path.join(__dirname, 'public'),
},
historyApiFallback: true,
compress: true,
hot: true,
port: 3000,
},
plugins: [
new HtmlWebpackPlugin({
template: './public/index.html',
}),
new ReactRefreshWebpackPlugin(),
],
}