-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig-overrides.js
More file actions
32 lines (29 loc) · 967 Bytes
/
config-overrides.js
File metadata and controls
32 lines (29 loc) · 967 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
const ReactRefreshPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
module.exports = function override(config, env) {
// this is needed specifically to address the injection of extra code into worklets
// during `yarn start`, which was causing the `importScripts` error.
// from: https://github.com/webpack/webpack/issues/11543#issuecomment-1585715108
if (env === "development") {
config.plugins = config.plugins.filter(
(plugin) => plugin.constructor.name !== "ReactRefreshPlugin"
);
config.plugins.push(
new ReactRefreshPlugin({
overlay: false,
exclude: /(node_modules)|(.+\.worklet\.(ts|js)$)/i,
include: /\.([cm]js|[jt]sx?|flow)$/i,
})
);
}
config.module.parser = {
javascript: {
worker: [
"*context.audioWorklet.addModule()",
"*audioWorklet.addModule()",
// *addModule() is not valid syntax
"...",
],
},
};
return config;
};