-
Notifications
You must be signed in to change notification settings - Fork 3
/
config-overrides.js
34 lines (33 loc) · 1.02 KB
/
config-overrides.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
const path = require("path");
const CreateFileWebpack = require("create-file-webpack");
module.exports = function override(config, env) {
config.module.rules.push({
test: /\.worker\.js$/,
use: { loader: "worker-loader" }
});
config.resolve.alias = {
...config.resolve.alias,
["websocket$"]: path.resolve(
__dirname,
"src/reconnecting-websocket.ts"
),
/*
* we need the wavelet.client-cjs.js version to be loaded instead of
* wavelet-client.umd.js for which we can't overwrite dependencies
*/
["wavelet-client$"]: path.resolve(
__dirname,
"node_modules/wavelet-client/dist/wavelet-client.cjs.js"
)
};
if (process.env.REACT_APP_CNAME) {
config.plugins.push(
new CreateFileWebpack({
path: "./build",
fileName: "CNAME",
content: process.env.REACT_APP_CNAME
})
);
}
return config;
};