/
webpack.config.tests.cjs
79 lines (76 loc) · 1.78 KB
/
webpack.config.tests.cjs
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
const webpack = require ("webpack");
const fs = require ("fs");
const ppath = require ("path");
const packageStr = fs.readFileSync (process.cwd () + "/package.json").toString ();
const packageJSON = JSON.parse (packageStr);
let packageVersion = packageJSON.version.toString ();
module.exports = {
entry: "./tests/components/Components.ts",
devtool: "inline-source-map",
target: "web",
module: {
rules: [{
test: new RegExp ("\.tsx?$"),
use: [{
loader: "ts-loader",
options: {
transpileOnly: true,
configFile: "tsconfig-web.json"
}
}],
exclude: new RegExp ("node_modules")
}]
},
plugins: [
new webpack.DefinePlugin ({
__VERSION__: `\"${packageVersion}\"`
}),
new webpack.IgnorePlugin ({
resourceRegExp: /HotHTTPServer|HotTesterMochaSelenium|HotTestSeleniumDriver|HotTesterMocha|express|mysql/
})
],
resolve: {
extensions: [".tsx", ".ts", ".js"],
fallback: {
fs: false,
path: false,
net: false,
tls: false,
crypto: false,
buffer: false,
https: false,
http: false,
net: false,
process: false,
child_process: false,
stream: false,
worker_threads: false,
url: false,
util: false,
zlib: false
}
},
externals: {
"validate-npm-package-name": "{}",
"node:path": "{}",
"node:buffer": "{}",
"node:fs": "{}",
"node:crypto": "{}",
"node:https": "{}",
"node:http": "{}",
"node:net": "{}",
"node:process": "{}",
"node:child_process": "{}",
"node:stream/web": "{}",
"node:stream": "{}",
"node:url": "{}",
"node:util": "{}",
"node:zlib": "{}"
},
output: {
filename: "HotStaqTests.js",
path: ppath.resolve (process.cwd (), "build-web"),
library: "HotStaqTests",
libraryTarget: "umd"
}
};