-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathwebpack.server.config.js
More file actions
40 lines (39 loc) · 920 Bytes
/
webpack.server.config.js
File metadata and controls
40 lines (39 loc) · 920 Bytes
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
const path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
mode: "production",
name: "server",
target: "node",
externalsPresets: { node: true }, // in order to ignore built-in modules like path, fs, etc.
// Prevent webpack trying to build these
externals: {
express: "commonjs2 express",
"ffi-rs": "commonjs2 ffi-rs",
},
entry: "./src/server/server.ts",
output: {
filename: "server.js",
path: path.resolve(__dirname, "build"),
},
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
],
},
plugins: [
new CopyPlugin({
// Copy the appropriate native binary for your platform
patterns: [{ from: "src/runtimes/win-x64/native", to: "" }],
}),
],
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
node: {
__dirname: false,
},
};