-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-overrides.js
36 lines (35 loc) · 1.28 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
35
36
const webpack = require("webpack");
const ModuleScopePlugin = require("react-dev-utils/ModuleScopePlugin");
module.exports = function override(config) {
config.resolve.plugins = config.resolve.plugins.filter((plugin) => !(plugin instanceof ModuleScopePlugin));
// https://github.com/lingui/js-lingui/issues/1195
// Adding loader to use for .po files to webpack
const webpackLoaders = config.module.rules[0].oneOf;
webpackLoaders.splice(webpackLoaders.length - 1, 0, {
test: /\.po/,
use: [
{
loader: "@lingui/loader",
},
],
});
const fallback = config.resolve.fallback || {};
Object.assign(fallback, {
stream: require.resolve("stream-browserify"),
http: require.resolve("stream-http"),
https: require.resolve("https-browserify"),
os: require.resolve("os-browserify/browser"),
process: require.resolve("process"),
crypto: require.resolve("crypto-browserify"),
querystring: require.resolve("querystring-es3"),
});
config.resolve.fallback = fallback;
config.resolve.alias["@uniswap/v3-sdk"] = require.resolve("@uniswap/v3-sdk/dist/index.js");
config.plugins = (config.plugins || []).concat([
new webpack.ProvidePlugin({
process: "process/browser.js",
Buffer: ["buffer", "Buffer"],
}),
]);
return config;
};