forked from kui/7dtd-map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.ts
executable file
·42 lines (38 loc) · 1016 Bytes
/
webpack.config.ts
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
import path from "path";
import glob from "glob";
const BASE_DIR = path.resolve("src");
const EXCLUDE_FILES = ["**/jest.config.*"];
module.exports = (_: void, argv: { mode: string }) => {
const isDev = argv.mode == "development";
const entry = glob.sync(path.join(BASE_DIR, "{,worker}", "*.ts"), { ignore: EXCLUDE_FILES }).reduce((obj, p) => {
const name = path.relative(BASE_DIR, p).replace(/\.ts$/, "");
return Object.assign(obj, { [name]: p });
}, {});
console.log(entry);
return {
entry,
output: {
filename: "[name].js",
path: path.resolve(__dirname, "docs"),
},
devtool: isDev ? "inline-source-map" : "source-map",
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
options: {
transpileOnly: true,
//configFile: "src/tsconfig.json",
},
},
],
},
resolve: {
extensions: [".ts", ".js"],
},
performance: {
hints: false,
},
};
};