forked from akash-network/console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.js
40 lines (38 loc) · 1.21 KB
/
webpack.dev.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
const path = require("path");
const NodemonPlugin = require("nodemon-webpack-plugin");
const nodeExternals = require("webpack-node-externals");
const hq = require("alias-hq");
const webpack = require("webpack");
const { NODE_ENV = "development" } = process.env;
module.exports = {
entry: "./src/index.ts",
mode: NODE_ENV,
target: "node",
devtool: "source-map",
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"
}
]
},
plugins: [new NodemonPlugin(), new webpack.IgnorePlugin({ resourceRegExp: /^pg-native$/ })],
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/
]
};