You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new code-shared structure is based on remapped imports and we strongly recommended to use them in code-shared applications. This way, typescript compiler will take the correct file (with .tns or .web extension) depending on the platform you're building for - web or mobile. Here are the steps that you need to follow in order to migrate existing code-shared application with legacy structure to the new structure:
The new code-shared structure is based on remapped imports and we strongly recommended to use them in code-shared applications. This way, typescript compiler will take the correct file (with
.tns
or.web
extension) depending on the platform you're building for - web or mobile. Here are the steps that you need to follow in order to migrate existing code-shared application with legacy structure to the new structure:Setup correctly
paths
property insidetsconfig
filestsconfig.json
tsconfig.tns.json
tsconfig.app.json
Fix all relative imports inside project
The relative imports should be migrated to starts with
@src
as only non-relative imports can be resolved through path mapping and TypeScript compiler is already configured to understand@src
symbol. This can be achieved automatically using the @nativescript/tslint-rules package.Setup
@nativescript/tslint-rules
Install it into project
npm i @nativescript/tslint-rules --save-dev
Configure tslint.json
Execute the rules
After that all relative imports should be changed and should start with
@src
symbol.The text was updated successfully, but these errors were encountered: