forked from microsoft/responsible-ai-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
34 lines (31 loc) · 798 Bytes
/
webpack.config.js
File metadata and controls
34 lines (31 loc) · 798 Bytes
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
const nrwlConfig = require("@nrwl/react/plugins/webpack.js"); // require the main @nrwl/react/plugins/webpack configuration function.
module.exports = (config) => {
nrwlConfig(config); // first call it so that it @nrwl/react plugin adds its configs,
config.node = {
module: "empty",
dgram: "empty",
dns: "mock",
fs: "empty",
http2: "empty",
net: "empty",
tls: "empty",
child_process: "empty"
};
config.module.rules.push({
test: /\.py$/i,
use: "raw-loader"
});
config.module.rules.unshift({
test: /\.worker\.ts$/i,
loader: "worker-loader",
options: {
inline: "no-fallback"
}
});
if (process.env.debug) {
require("fs-extra").writeJSONSync("./webpack.json", config, {
spaces: 2
});
}
return config;
};