-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.server.js
More file actions
39 lines (38 loc) · 796 Bytes
/
webpack.server.js
File metadata and controls
39 lines (38 loc) · 796 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
const nodeExternals = require("webpack-node-externals");
const path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
name: "server",
entry: {
server: path.resolve(__dirname, "server/app.ts"),
},
mode: "production",
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].js",
},
resolve: {
extensions: [".ts", ".tsx"],
},
plugins: [
new CopyPlugin({
patterns: [{ context: "server", from: "views", to: "views" }],
}),
],
externals: [nodeExternals()],
target: "node",
node: {
__dirname: false,
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
options: {
configFile: "tsconfig.server.json",
},
},
],
},
};