forked from juspay/hyperswitch-control-center
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.server.js
32 lines (31 loc) · 830 Bytes
/
webpack.server.js
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
const path = require("path");
const webpack = require("webpack");
const { execSync } = require("child_process");
const CopyWebpackPlugin = require("copy-webpack-plugin");
var currentCommitHash = execSync("git rev-parse HEAD", {
encoding: "utf-8",
}).trim();
module.exports = {
mode: "development",
entry: {
server: "./src/server/Server.res.js",
},
output: {
filename: `server.js`,
path: path.resolve(__dirname, "dist/server"),
clean: true,
publicPath: "/",
},
target: "node",
plugins: [
new webpack.DefinePlugin({
GIT_COMMIT_HASH: JSON.stringify(currentCommitHash),
IS_SCOPING_MODULE_ACTIVE: JSON.stringify(
process.env.IS_SCOPING_MODULE_ACTIVE || "true",
),
}),
new CopyWebpackPlugin({
patterns: [{ from: "config", to: "config" }],
}),
],
};