-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
61 lines (60 loc) · 1.74 KB
/
webpack.config.js
File metadata and controls
61 lines (60 loc) · 1.74 KB
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
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const WriteFilePlugin = require("write-file-webpack-plugin");
const nodeExternals = require("webpack-node-externals");
module.exports = {
entry: {
confirmer: "./src/apps/confirmer/confirmer.ts",
executor: "./src/apps/executor/executor.ts",
fee_collector: "./src/apps/fee_collector/index.ts",
play_manager: "./src/apps/play_manager/play_manager.ts",
server: "./src/apps/server/index.ts",
watcher: "./src/apps/watcher/watcher.ts",
pfp_icon_checker: "./src/apps/pfp_icon_checker/index.ts",
rovi_tournament_manager: "./src/apps/rovi_tournament_manager/index.ts",
paid_tournament_manager: "./src/apps/paid_tournament_manager/index.ts",
},
target: "node",
devtool: "inline-source-map",
plugins: [
// Prismaがネイティブモジュールとschema.prismaファイルがないと動作しないのでコピーする
new CopyWebpackPlugin({
patterns: [
{
from: "./prisma/schema.prisma",
to: "./schema.prisma",
},
{
from: "./node_modules/.prisma/client/*.node",
to({ context, absoluteFilename }) {
return Promise.resolve("[name][ext]");
},
},
],
}),
new WriteFilePlugin(),
],
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
],
},
resolve: {
extensions: [".ts", ".mjs", ".js"],
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "dist"),
libraryTarget: "commonjs2",
},
mode: "development",
optimization: {
usedExports: true,
},
externalsPresets: { node: true },
externals: [nodeExternals()],
};