I'm using Typescript (version 2.2.1) in VSCode (version 1.10.2) for my React Native project and I'm trying to get the compiler to map *.android.ts and *.ios.ts paths by using the instructions at:
For example:
import ApplicationTabs from './ApplicationTabs';
should map to
import ApplicationTabs from './ApplicationTabs/index.ios';
with the following tsconfig.json settings
{
"compilerOptions": {
"paths": {
"*": ["*", "*.ios", "*.android"]
}
}
}
but instead throws the compiler throws the error "[ts] cannot find module './ApplicationTabs'"
Does anyone know how I might get the compiler to map to *.android.ts and *.ios.ts paths correctly?
My tsconfig.json is:
{
"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 :-)