-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathwebpack.testconfig.ts
81 lines (79 loc) · 2 KB
/
webpack.testconfig.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import * as webpack from "webpack";
import * as glob from "glob";
import * as path from "path";
const config: webpack.Configuration = {
entry: glob.sync(path.join(__dirname, "test/**/*[^node.].ts")),
mode: "development",
devtool: "source-map",
stats: {
colors: true,
hash: false,
version: false,
timings: false,
assets: false,
chunks: false,
modules: false,
reasons: false,
children: false,
source: false,
errors: true,
errorDetails: false,
warnings: false,
publicPath: false,
},
output: {
filename: "msRest.browser.test.js",
path: path.resolve(__dirname, "test"),
},
plugins: [
new webpack.NormalModuleReplacementPlugin(
/(\.).+util\/base64/,
path.resolve(__dirname, "./lib/util/base64.browser.ts")
),
new webpack.NormalModuleReplacementPlugin(
/(\.).+util\/xml/,
path.resolve(__dirname, "./lib/util/xml.browser.ts")
),
new webpack.NormalModuleReplacementPlugin(
/(\.).+defaultHttpClient/,
path.resolve(__dirname, "./lib/defaultHttpClient.browser.ts")
),
new webpack.NormalModuleReplacementPlugin(
/(\.).+msRestUserAgentPolicy/,
path.resolve(__dirname, "./lib/policies/msRestUserAgentPolicy.browser.ts")
),
new webpack.NormalModuleReplacementPlugin(
/(\.).+agentPolicy/,
path.resolve(__dirname, "./lib/policies/agentPolicy.browser.ts")
),
new webpack.NormalModuleReplacementPlugin(
/(\.).+proxyPolicy/,
path.resolve(__dirname, "./lib/policies/proxyPolicy.browser.ts")
),
],
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
exclude: /(node_modules)/,
options: { configFile: path.join(__dirname, "./tsconfig.es.json") },
},
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
node: {
dns: false,
fs: "empty",
net: "empty",
path: "empty",
process: "mock",
tls: "empty",
tty: false,
tunnel: "empty",
v8: false,
},
};
export = config;