I'm trying to use bignumber.js with typescript, and everything is fine if I just run react-scripts start
, typescript picks up the correct library when I wite import { BigNumber } from "bignumber.js";
.
However, once I build the project by running tsc && react-scripts build
, the built version doesn't use my desired BigNumber class from bignumber.js. Instead, it picks up the BigNumber class from ether.js/bignumber.ts (I also need ether.js in my project). Any idea about why this happens? My compiler option is the following
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": [
"DOM",
"DOM.Iterable",
"ESNext"
],
"types": [
"node",
"webpack-env" // here
],
"baseUrl": ".",
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"noFallthroughCasesInSwitch": true
},
"include": [
"./src"
]
}
Via Active questions tagged javascript - Stack Overflow https://ift.tt/KjX7o82
Comments
Post a Comment