Commit d8e495a
authored
fix-next: stop preferring android-specific files over ios-specif… (#236)
In the current prerelease version, `*.android.ts` files are preferred over `*.ios.ts` files even when
building for iOS. To reproduce execute:
```
npm i @nativescript/schematics@0.6.1-2019-08-05-173433-01
ng new --shared --collection=@nativescript/schematics shared-project
cd shared-project/src/app
echo "console.log('ANDROID');" > print.android.ts
echo "console.log('IOS');" > print.ios.ts
echo "import '@src/app/print';" >> app.module.ts
tns run ios
```
As a result you will see `ANDROID` printed on the console, meaning that
the Android-specific file was imported even though we built the
application for iOS.
This behaviour is caused by the configuration of the `"paths"` property in
`tsconfig.tns.json`, which tells the TS compiler to look for
`*.android.ts` files first:
```
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@src/*": [
"src/*.android.ts",
"src/*.ios.ts",
"src/*.tns.ts",
"src/*.ts"
]
}
}
```
This PR removes the `*.android.ts` and `*.ios.ts` lines from the
configuration, delegating the `android` and `ios` file resolution to webpack.1 parent 043bd38 commit d8e495a
3 files changed
+2
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| |||
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | | - | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
149 | 147 | | |
150 | 148 | | |
151 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| |||
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | | - | |
| 16 | + | |
0 commit comments