-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.js
65 lines (55 loc) · 1.36 KB
/
webpack.config.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const path = require("path");
const TSConfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const webpack = require("webpack");
const nodeExternals = require("webpack-node-externals");
const isProd = process.env.NODE_ENV == "production";
module.exports = {
mode: process.env.NODE_ENV,
entry: {
index: "src/index.ts",
child_find: "src/lib/childProcesses/child_find.ts",
child_delete: "src/lib/childProcesses/child_delete.ts",
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, isProd ? "build" : "build-dev"),
},
watch: !isProd,
watchOptions: {
ignored: "node_modules/**",
},
devtool: isProd ? "inline-source-map" : false,
target: "node",
externals: [nodeExternals()],
plugins: [
new webpack.BannerPlugin({
banner: "#!/usr/bin/env node",
raw: true,
include: "index.js",
}),
],
module: {
rules: [
{
test: /\.(tsx|ts|js)?$/,
use: [
{
loader: "ts-loader",
options: {
configFile: "tsconfig.json",
},
},
],
exclude: /node_modules/,
},
],
},
resolve: {
plugins: [new TSConfigPathsPlugin({ configFile: "tsconfig.json" })],
extensions: [".tsx", ".ts", ".js"],
alias: {
"@app": path.resolve(__dirname, "src"),
},
},
};
// #!/usr/bin/env node