Answers for "tsconfig paths not working"

0

tsconfig paths not working react native

//react native or expo
//1. open package.json
//(change myapp to whatever you want to, it can even be src.)
{
  "name": "myapp"
}
//2. update your tsconfig.json file
{
  "compilerOptions": {
     ...
     "baseUrl": "./",
     "paths": {
        "myapp/*": ["*"]
      },
     ...
  }
}
//3.In your.tsx file
import { MyThing } from 'myapp/MyThing';
Posted by: Guest on June-07-2022
-1

build with tsconfig-paths

{
  "scripts": {
    "start": "node -r tsconfig-paths/register -r ts-node                 
              ./src/index/ts",
    "build": "tsc --project tsconfig.json && tscpaths -p
              tsconfig.json -s ./src -o ./dist"
  }
}
Posted by: Guest on October-01-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language