-
Notifications
You must be signed in to change notification settings - Fork 16
/
webpack.config.js
58 lines (57 loc) · 1.47 KB
/
webpack.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
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require("path");
const webpack = require("webpack");
module.exports = {
entry: "./src/browser-tests/index.ts",
mode: "development",
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
],
},
plugins: [
new webpack.ProvidePlugin({
process: "process/browser",
}),
],
resolve: {
extensions: [".tsx", ".ts", ".js"],
alias: {
// Since this is for running in the browser, we don't include the node context Xrm.WebApi
config: path.resolve(__dirname, "src/browser-tests/config-browser"),
"../../../webapi/node/SetupGlobalContext": path.resolve(__dirname, "src/browser-tests/SetupGlobalContext"),
"../../SetupGlobalContext": path.resolve(__dirname, "src/browser-tests/SetupGlobalContext"),
},
fallback: {
crypto: false,
path: false,
https: false,
fs: false,
util: false,
buffer: false,
querystring: false,
assert: false,
http: false,
tls: false,
url: false,
net: false,
module: false,
stream: false,
zlib: false,
constants: false,
tunnel: false,
},
},
devtool: "eval-source-map",
output: {
path: path.resolve(__dirname, "dist-tests"),
filename: "browser-tests.js",
// Set this to your namespace e.g. cds.ClientHooks
library: ["tests"],
libraryTarget: "var",
},
};