Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GENERATE_SOURCEMAP=false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it mean local server and/or test stands won't have source maps?

Copy link
Contributor Author

@vipineth vipineth Jun 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is set for production.

From docs:

When set to false, source maps are not generated for a production build. This solves out of memory (OOM) issues on some smaller machines.

https://create-react-app.dev/docs/advanced-configuration/

Active PR for the issue: facebook/create-react-app#11752

22 changes: 22 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = function override(config) {
// https://github.com/lingui/js-lingui/issues/1195
// Adding loader to use for .po files to webpack
const loaders = config.module.rules.find((rule) => Array.isArray(rule.oneOf));
loaders.oneOf.splice(loaders.length - 1, 0, {
test: /\.po/,
use: [
{
loader: "@lingui/loader",
},
],
});

config.resolve.fallback = {
os: false,
http: false,
https: false,
stream: false,
crypto: false,
};
return config;
};
28 changes: 15 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@types/react-dom": "18.0.6",
"@types/react-router-dom": "5.3.3",
"@uniswap/sdk-core": "3.0.1",
"@uniswap/v3-sdk": "3.7.1",
"@uniswap/v3-sdk": "3.9.0",
"@web3-react/core": "6.1.9",
"@web3-react/injected-connector": "6.0.7",
"@web3-react/walletconnect-connector": "6.2.8",
Expand All @@ -44,7 +44,7 @@
"react-icons": "4.3.1",
"react-remove-scroll": "2.5.5",
"react-router-dom": "5.3.0",
"react-scripts": "4.0.3",
"react-scripts": "5.0.1",
"react-select": "5.2.1",
"react-tabs": "3.2.3",
"react-toastify": "6.0.9",
Expand All @@ -59,15 +59,15 @@
"react-error-overlay": "6.0.9"
},
"scripts": {
"start": "PORT=3010 react-scripts start",
"start-home": "yarn lingui:prepare && PORT=3010 env-cmd -e development-home react-scripts start",
"start-app": "yarn lingui:prepare && PORT=3011 env-cmd -e development-app react-scripts start",
"start-win": "set PORT=3010&react-scripts start",
"build": "INLINE_RUNTIME_CHUNK=false yarn test:ci && react-scripts build",
"build-home": "INLINE_RUNTIME_CHUNK=false env-cmd -e production-home react-scripts build",
"build-app": "INLINE_RUNTIME_CHUNK=false env-cmd -e production-app yarn test:ci && react-scripts build",
"test": "react-scripts test",
"test:ci": "react-scripts test --watchAll=false",
"start": "PORT=3010 react-app-rewired start",
"start-home": "yarn lingui:prepare && PORT=3010 env-cmd -e development-home react-app-rewired start",
"start-app": "yarn lingui:prepare && PORT=3011 env-cmd -e development-app react-app-rewired start",
"start-win": "set PORT=3010&react-app-rewired start",
"build": "INLINE_RUNTIME_CHUNK=false yarn test:ci && react-app-rewired build",
"build-home": "INLINE_RUNTIME_CHUNK=false env-cmd -e production-home react-app-rewired build",
"build-app": "INLINE_RUNTIME_CHUNK=false env-cmd -e production-app yarn test:ci && react-app-rewired build",
"test": "react-app-rewired test",
"test:ci": "react-app-rewired test --watchAll=false",
"eject": "react-scripts eject",
"lint": "node node_modules/.bin/eslint src",
"pre-commit": "npm run test -- --watchAll=false && npm run lint",
Expand Down Expand Up @@ -103,10 +103,12 @@
"@lingui/cli": "^3.13.3",
"@lingui/loader": "3.14.0",
"@lingui/macro": "3.13.3",
"eslint": "7.32.0",
"eslint": "^8.41.0",
"eslint-config-react-app": "^7.0.1",
"husky": "7.0.4",
"lint-staged": "12.3.4",
"prettier": "2.5.1"
"prettier": "2.5.1",
"react-app-rewired": "2.2.1"
},
"lint-staged": {
"src/**/*.{js,ts,jsx,tsx}": [
Expand Down
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// #
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting an error and it was suggested to have a file named index.d.ts. So I added that. I will look into the issue properly.

2 changes: 1 addition & 1 deletion src/lib/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { i18n } from "@lingui/core";
import { i18n, Messages } from "@lingui/core";
import { en, es, zh, ko, ru, ja, fr, de } from "make-plural/plurals";
import { LANGUAGE_LOCALSTORAGE_KEY } from "config/localStorage";
import { isDevelopment } from "config/env";
Expand Down
4 changes: 2 additions & 2 deletions src/lib/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,7 @@ export function getTradePageUrl() {
}

export function importImage(name) {
let tokenImage: { default: string } | null = null;
let tokenImage = "";

try {
tokenImage = require("img/" + name);
Expand All @@ -1466,7 +1466,7 @@ export function importImage(name) {
console.error(error);
}

return tokenImage?.default;
return tokenImage;
}

export function getTwitterIntentURL(text, url = "", hashtag = "") {
Expand Down
Loading