-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.dev.ts
37 lines (35 loc) · 868 Bytes
/
webpack.dev.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
const webpack = require("webpack");
const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
import merge from "webpack-merge";
// @ts-ignore
import common from "./webpack.common";
const config = {
mode: "development",
output: {
publicPath: "http://localhost:4444/",
},
entry: ["./src/index"],
target: "web",
devtool: "eval-cheap-module-source-map",
plugins: [
new ReactRefreshWebpackPlugin(),
new webpack.EnvironmentPlugin({
API: "http://localhost:8000",
}),
],
devServer: {
before: (app: any) => {
app.use("*", (req: any, res: any, next: any) => {
res;
console.log(req.baseUrl);
next();
});
},
clientLogLevel: "error",
port: 4444,
stats: "minimal",
hot: true,
historyApiFallback: true,
},
};
module.exports = merge(common, config);