-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cracorc.js
45 lines (38 loc) · 1.29 KB
/
.cracorc.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
const { getLoader, loaderByName, addPlugins } = require('@craco/craco');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
module.exports = {
webpack: {
configure: (config) => {
addPlugins(config, [new NodePolyfillPlugin()]);
/**
* Replace `resolve.plugins` to allow compiling packages outside of `src`
*/
config.resolve.plugins = [new TsconfigPathsPlugin()];
/**
* Fix build errors after adding @biconomy/[email protected]
*
* TODO: check if this fix is still relevant when the lib's new version is available
*/
config.resolve.fallback = {
net: false,
tls: false,
};
/**
* TODO: Figure out a better approach of compiling packages outside of `src` (eg. by using project references)
*
* Let Babel compile outside of `src`
*/
const { match } = getLoader(config, loaderByName('babel-loader'));
Object.assign(match.loader, {
include: undefined,
exclude: /node_modules/,
});
/**
* Suppress warning about missing source maps from 3rd party libraries
*/
config.ignoreWarnings = [/Failed to parse source map/];
return config;
},
},
};