-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
46 lines (44 loc) · 1.19 KB
/
webpack.config.ts
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
import path from "path"
import ReactRefreshPlugin from "@pmmmwh/react-refresh-webpack-plugin"
import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"
import { Configuration as WebpackConfiguration } from "webpack"
import { Configuration as WebpackDevServerConfiguration } from "webpack-dev-server"
interface Configuration extends WebpackConfiguration {
devServer?: WebpackDevServerConfiguration
}
const config: Configuration = {
name: "lotto-dev",
mode: "development",
devtool: "eval",
resolve: {
extensions: [".js", ".jsx", ".tsx", ".ts"],
},
entry: {
app: "./client",
},
module: {
rules: [
{
loader: "babel-loader",
options: { plugins: ["react-refresh/babel"] },
},
{
test: /\.tsx?$/,
loader: "ts-loader",
exclude: path.join(__dirname, "node_modules"),
},
],
},
plugins: [new ReactRefreshPlugin(), new ForkTsCheckerWebpackPlugin()],
output: {
path: path.join(__dirname, "dist"),
filename: "[name].js",
publicPath: "/dist/",
},
devServer: {
devMiddleware: { publicPath: "/dist" },
static: { directory: path.resolve(__dirname) },
hot: true,
},
}
export default config