-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
30 lines (25 loc) · 877 Bytes
/
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
import dotenv from "dotenv";
import path from "path";
import { buildWebpackConfig } from "./config/build/build_webpack_config";
import { BuildEnv } from "./config/build/types/config";
dotenv.config();
export default (env: BuildEnv) => {
const isDev = env.mode === "development";
const pathDist = path.resolve(__dirname, "dist");
const publicDist = path.resolve(__dirname, "public");
return buildWebpackConfig({
mode: env.mode,
isDev,
devtool: isDev ? "inline-source-map" : false,
paths: {
dist: pathDist,
entry: "./src/index.tsx",
html: path.resolve(publicDist, "index.html"),
src: path.resolve(__dirname, "src"),
env: path.resolve(__dirname, ".env"),
locales: path.resolve(publicDist, "locales"),
buildLocales: path.resolve(pathDist, "locales"),
},
port: Number(process.env.CLIENT_PORT),
});
};