-
Notifications
You must be signed in to change notification settings - Fork 56
/
webpack.prod.js
47 lines (45 loc) · 1.29 KB
/
webpack.prod.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const path = require("path");
const webpack = require("webpack");
const nodeExternals = require("webpack-node-externals");
const CopyPlugin = require("copy-webpack-plugin");
const hq = require("alias-hq");
const { NODE_ENV = "production" } = process.env;
module.exports = {
entry: "./src/index.ts",
mode: NODE_ENV,
target: "node",
output: {
path: path.resolve(__dirname, "dist"),
filename: "server.js"
},
resolve: {
extensions: [".ts", ".js"],
alias: hq.get("webpack")
},
externals: [nodeExternals(), { "winston-transport": "commonjs winston-transport" }],
module: {
rules: [
{
test: /\.(ts|js)x?$/,
exclude: /node_modules/,
loader: "ts-loader"
}
]
},
optimization: {
minimize: false
},
plugins: [
new webpack.IgnorePlugin({ resourceRegExp: /^pg-native$/ }),
new CopyPlugin({
patterns: [{ from: "drizzle", to: "drizzle" }]
})
],
node: {
__dirname: true
},
ignoreWarnings: [
// TODO: Fix this warning at some point. Essentially webpack is warning that it is not able to resolve the dependency because it's an expression and not a string literal. This is a known issue with webpack and it's safe to ignore it for now.
/Critical dependency: the request of a dependency is an expression/
]
};