8

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

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.