Some module require that you download external Javascript-libraries, and in drupal 8 that should be done in Composer.
The module Masonry require the JavaScript library with the same name. So we need to include the package in composer.json, like:
“repositories”:[
{
“type”:”composer”,
“url”:”https://packages.drupal.org/8″
},
{
“type”: “package”,
“package”: {
“name”: “desandro/masonry”,
“version”: “master”,
“type”: “drupal-library”,
“dist”: {
“url”: “https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js”,
“type”: “file”
}
}
},
And in the require part that is:
“require”:{
…
“desandro/masonry”:”master”,
…
},
And then we need to add libraries in extra part of we do not have that:
“extra”:{
…
“web/libraries/{$name}”:[
“type:drupal-library… Read More
Source: New feed