-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
54 lines (52 loc) · 1.34 KB
/
webpack.config.js
File metadata and controls
54 lines (52 loc) · 1.34 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
47
48
49
50
51
52
53
54
/*
We both know that this configuration is way overkill for a simple portfolio site.
- _"Your site would be so much smaller/faster/simpler if you just wrote it in HTML/CSS/JS"_
- I know... but the purpose of this is really to kick the tires on what my brain has actually accumulated.
Plus I get to try out new stuff so shove it.
*/
const path = require('path')
const HTMLWebpackPlugin = require('html-webpack-plugin') // generates the HTML file for the app
const ReactRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin') // Experimental -- 1/16/2021 This may need to be replaced
const ForkTSCheckerPlugin = require('fork-ts-checker-webpack-plugin') // Forks type checking etc to speed up build
module.exports = {
entry: './src/index.tsx',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'client.js'
},
watch: true,
mode: 'development',
devServer: {
port: 8083,
compress: true,
hot: true
},
module: {
rules: [
{
test: /\.ts(x)$/,
use: [
{
loader: 'babel-loader',
options: {
plugins: ['react-refresh/babel']
}
},
{
loader: 'ts-loader',
options: {
transpileOnly: true
}
}
]
}
]
},
plugins: [
new ReactRefreshPlugin(),
new ForkTSCheckerPlugin(),
new HTMLWebpackPlugin({
filename: './index.html'
})
]
}