The module should have the composer file listing all the dependencies. Installing the module should install the libraries in respective directories.

Solution:

Maintainer please add composer.json file in the module with following code.

{
  "name": "drupal/masonry",
  "description": "Masonry integrates with Masonry library",
  "homepage": "https://www.drupal.org/project/masonry",
  "license": "GPL-2.0+",
  "repositories": [
    {
      "type": "package",
      "package": {
        "name": "masonry/masonry",
        "version": "3.3.2",
        "type": "drupal-library",
        "dist": {
          "url": "https://npmcdn.com/masonry-layout@3.3.2/dist/masonry.pkgd.min.js",
          "type": "file"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "imagesloaded/imagesloaded",
        "version": "4.1.4",
        "type": "drupal-library",
        "dist": {
          "url": "https://imagesloaded.desandro.com/imagesloaded.pkgd.min.js",
          "type": "file"
        }
      }
    }
  ],
  "require": {
    "masonry/masonry": "^3.3",
    "imagesloaded/imagesloaded": "^4.1"
  }
}

Comments

majid.ali created an issue. See original summary.

quotientix’s picture

+1

dom.’s picture

Status: Needs review » Closed (duplicate)

Hi thanks a lot for contribution.
I am closing this as duplicate of #2955243: Composer / npm / bower support, and for this reason I have credited your work on that other issue @majid.ali