How do I download directory with LibMan?

1.6k views Asked by At

The new libman in Visual Studio is super simple and lightweight.

But I cannot figure out how to download a directory with it...

I have this config:

{
    "version": "1.0",
    "defaultProvider": "cdnjs",
    "defaultDestination": "lib",
    "libraries": [
        {
            "library": "[email protected]",
            "destination": "lib/_jquery",
            "files": [ "jquery.js" ]
        },
        {
            "library": "[email protected]",
            "destination": "lib/jqueryui",
            "files": [ "jquery-ui.css", "jquery-ui.js", "images" ]
        }
    ]
}

But the images folder in the jqueryui lib doesn't download the images folder.

Also tried images/* and images/*.* to no avail.

If I don't specify any files, then I get the whole lib, including all folders. But that downloads all themes as well.

So how do I just download specific dirs?

2

There are 2 answers

0
Anderson Meurer On

There is no way to specify patterns to get the files from a library currently.

Libman just get all the files in the library and builds a dictionary to the file path specified and check if exists or not, unfortunately.

https://github.com/aspnet/LibraryManager/wiki/libman.json-reference#packagesfiles-required-by-some-providers

0
Mentor On

You can load each folder level in the hierarchy individually:

{
  "version": "1.0",
  "defaultProvider": "unpkg",
  "libraries": [
    {
      "library": "[email protected]",
      "destination": "wwwroot/lib/bootstrap/",
      "files": [
        "dist/*/*.*"
      ]
    }
  ]
}