Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate NativeScript into @nrwl/nx

Tags:

angular

nrwl

How to share code between multiple NativeScript apps and multiple Angular apps using @nrwl/nx (Nx Workspace)?

like image 765
Samuel R Avatar asked Mar 16 '18 16:03

Samuel R


2 Answers

Have a look at https://nstudio.io/xplat/. It seems these guys are trying to make it easier, but it still isn't an easy thing to do.

like image 197
Blake Avatar answered Nov 15 '22 05:11

Blake


I tried out xplat. It did look promising but I was trying to integrate into an existing codebase and it felt disjointed trying to figure out what belonged in their core and how I was supposed to deal with all the existing modules each with their own service that used HttpClientModule and needed to be converted to using the NativeScript version.

Instead, I ended up going with the Code Sharing approach that NativeScript recommends. Code Sharing

This method complicates the folder structure as you duplicate any file in-place that needs to be different for NativeScript. Basically, you add .tns just before the file extension. Then it uses some build tools that use those files when they are there.

like image 38
Jedediah Smith Avatar answered Nov 15 '22 04:11

Jedediah Smith