forked from ChainSafe/lodestar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.test.config.js
66 lines (65 loc) · 1.57 KB
/
webpack.test.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
66
const webpack = require("webpack");
const ResolveTypeScriptPlugin = require("resolve-typescript-plugin");
module.exports = {
mode: "production",
target: "web",
experiments: {
topLevelAwait: true,
},
optimization: {
minimize: false,
},
stats: {
errors: true,
errorDetails: true,
},
plugins: [
new webpack.ProvidePlugin({
process: "process/browser.js",
// eslint-disable-next-line @typescript-eslint/naming-convention
Buffer: ["buffer", "Buffer"],
}),
],
module: {
exprContextCritical: false,
rules: [
{
test: /\.ts?$/,
use: [
{
loader: "ts-loader",
options: {
configFile: "tsconfig.e2e.json",
experimentalFileCaching: true,
transpileOnly: true,
projectReferences: true,
},
},
],
exclude: [/node_modules/],
},
],
},
resolve: {
plugins: [new ResolveTypeScriptPlugin({includeNodeModules: false})],
fallback: {
path: require.resolve("path-browserify"),
"node:path": require.resolve("path-browserify"),
http: require.resolve("stream-http"),
https: require.resolve("https-browserify"),
stream: require.resolve("stream-browserify"),
"node:stream": require.resolve("stream-browserify"),
"@chainsafe/blst": false,
process: false,
fs: false,
os: false,
zlib: false,
crypto: false,
url: false,
},
alias: {
process: "process/browser.js",
},
extensions: [".ts", ".js"],
},
};