I am using Typescript (version 2.2.1) in VSCode (version 1.10.2) for my React Native project, and I am trying to get the compiler to display * .android.ts and * .ios. ts using the commands:
https://github.com/Microsoft/TypeScript-Handbook/blob/release-2.0/pages/Module%20Resolution.md#path-mapping
For instance:
import ApplicationTabs from './ApplicationTabs';
should display on
import ApplicationTabs from './ApplicationTabs/index.ios';
with the following tsconfig.json settings
{ "compilerOptions": { "paths": { "*": ["*", "*.ios", "*.android"] } } }
but instead, the compiler throws the error "[ts] cannot find module". / ApplicationTabs "
Does anyone know how I can get the compiler to correctly display the paths of * .android.ts and * .ios.ts?
My tsconfig.json:
{ "compilerOptions": { "target": "es6", "module": "es6", "moduleResolution": "node", "jsx": "react", "outDir": "build", "rootDir": "src", "removeComments": true, "allowSyntheticDefaultImports": true, "noImplicitAny": true, "experimentalDecorators": true, "preserveConstEnums": true, "allowJs": true, "inlineSourceMap": true, "sourceRoot": "src", "baseUrl": ".", "paths": { "*": [ "*", "*.ios", "*.android" ] } }, "filesGlob": [ "typings/**/*.d.ts", "src/**/*.ts", "src/**/*.tsx", "src/**/*.tsx" ], "exclude": [ "index.android.js", "index.ios.js", "build", "node_modules" ], "compileOnSave": false }
Thanks: -)