Skip to content

Request: Destination path pattern #438

@TristanApc

Description

@TristanApc

It would be incredibly useful to support some kind of pattern for the destination path. This would result in less error prone writing of libman.json and could make the migration to LibraryManager faster. In the context that I just performed a migration from Bower and most of the libraries that was in used in the project had a common, yet unique destination pattern.

For example, if you have dozens of libraries that you each want to put in a path of the following format:

wwwroot/lib/{nameOfLibrary}/dist at the moment you have to write the destination for every libraries since you can't use the defaultDestination as every destination are unique.

Minimal repro steps

libman.json with the following contents.

{
  "version": "1.0",
  "defaultProvider": "cdnjs",
  "destinationPattern": "wwwroot/lib/{library}/dist/"
  "libraries": [
    {
      "destination": "wwwroot/lib/eonasdan-bootstrap-datetimepicke/build/"
      "library": "eonasdan-bootstrap-datetimepicker@4.17.47"
    },
    {
        "library": "jquery@2.1.4"
    }
  ]
}

Expected result

A destination of the following form:

wwwroot/
     lib/
          eonasdan-bootstrap-datetimepicker/
               build/
                    ......

          jquery/
               dist/
                    ......

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions