libman.json
Here we look at using libman.json in Visual Studio.
libman.json is a great little utility that seems to come with Visual Studio 2019, libman.json may have been out before, but I didn't come across it until I started developing with .NET Core
Although you need to know it's syntax to get started with it, it is quite simple and certainly makes getting hold of client site libraries appear to be more clear than Nuget, which I have found can be more complicated.
Basically, you just edit the libman.json file (it's json syntax), specify which libraries you would like, and where to put them, and then it will download them automatically for you. Now I have done it twice, I already prefer this for client-side libraries, over Nuget.
Probably the best feature about libman.json, is that you can specify which folder your downloaded client side files will be located, whereas with Nuget you would download them first, and then move them around afterwards.
Here is an example of using libman.json to download AngularJS 1.8.0:
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
{
"library": "angular.js@1.8.0",
"destination": "wwwroot/lib/bootstrap"
}
]
}
Here is an example of using libman.json to download Bootstrap 4.4.1 and jQuery 3.5.1:
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
{
"library": "twitter-bootstrap@4.4.1",
"destination": "wwwroot/lib/bootstrap"
},
{
"library": "jquery@3.5.1",
"destination": "wwwroot/lib/jquery/"
}
]
}