forked from anon-real/sigma-usd
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig-overrides.js
More file actions
31 lines (25 loc) · 912 Bytes
/
config-overrides.js
File metadata and controls
31 lines (25 loc) · 912 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
const path = require('path');
const rewireTypingsForCssModule = require('react-app-rewire-typings-for-css-module');
module.exports = function override(config, env) {
/**
* Add WASM support
*/
// Make file-loader ignore WASM files
const wasmExtensionRegExp = /\.wasm$/;
config.resolve.extensions.push('.wasm');
config.module.rules.forEach(rule => {
(rule.oneOf || []).forEach(oneOf => {
if (oneOf.loader && oneOf.loader.indexOf('file-loader') >= 0) {
oneOf.exclude.push(wasmExtensionRegExp);
}
});
});
// Add a dedicated loader for WASM
config.module.rules.push({
test: wasmExtensionRegExp,
include: path.resolve(__dirname, 'src'),
use: [{ loader: require.resolve('wasm-loader'), options: {} }]
});
config = rewireTypingsForCssModule.factory({})(config);
return config;
};