-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the recommended method to add nativescript plugin #17
Comments
@mahmoudajawad This is a topic that comes up often. Generally Nx approach prefers to manage all dependencies at the root package.json. This typically works well and usually you could even share those root level package dependencies via file ref's to various app packages. However webpack5 does not currently like file referenced dependencies (those like "file: ../../etc.."). We've been exploring various configurations with webpack5 which may play well still with file ref'd deps as although it may look ugly it's quite useful in practice. We're also exploring the ability to not even have to define package dep's of {N} apps in their own package by utilize webpack to pull naturally from even the root package.json. Currently you will want to manage your dependencies at the root for the workspace in general and can configured package dep's in the {N} app as well. This will likely shift in the coming weeks as webpack5 is evolving fast. |
That's verbose and I appreciate. Also, what about using NS CLI to add plugin? Do I use |
@mahmoudajawad You can |
I see. That's where I failed as I didn't try to run the command from the app folder, but root. Would you welcome a quick PR to point this out in README? I do think adding it is worth it as huge part of NativeScript is its amazing eco-system of plug-ins and libs. |
@NathanaelA, what do you think of this: Also, I added some notes about versions as one of the biggest challenges I usually come across with any nativescript written-material is the inability to figure out the correct version-pool for the different parts of the structure. |
An update to using both the approaches:
at root-level, which rendered an error with |
Thank you - left couple quick comments there and with those changes a PR would be much appreciated.
This is something we've been investigating as well. We believe it's related to npm 7 or webpack5 or cli (or all the above). Anticipate having that triaged this month because that should work the same whether coming from root package or app's package but you are correct right now that if a plugin contains |
Closed by #22. |
When an NS app is created using this Nx plugin, it creates app-specific
packages.json
file inside the app folder. Assuming I'm going to install nativescript plugins to be used in the app using npm, whichpackages.json
file should be modified for that?On another instance, how can I use NS CLI to add plugins to apps in Nx workspace? Where the CLI would add the package, and is it the best practice for both NS and Nx?
The text was updated successfully, but these errors were encountered: