-
Notifications
You must be signed in to change notification settings - Fork 36
/
webpack.common.ts
40 lines (38 loc) · 858 Bytes
/
webpack.common.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
import path from "path"
import type { Configuration } from "webpack"
const common: Configuration = {
target: "node",
mode: "none",
resolve: {
mainFields: ["module", "main"],
extensions: [".js", ".ts"],
alias: {
"@": path.resolve(__dirname, "src"),
},
},
module: {
rules: [
{
test: /\.ts$/,
include: [path.resolve(__dirname, "src")],
loader: "ts-loader",
options: {
transpileOnly: true,
},
},
],
},
externals: {
// NOTE: Disable `node:{module}` import
// SEE: https://github.com/webpack/webpack/issues/14166
"node:process": "commonjs2 process",
"node:os": "commonjs2 os",
"node:tty": "commonjs2 tty",
},
ignoreWarnings: [{ module: /yargs/ }],
node: {
__dirname: false,
__filename: false,
},
}
export default common