Categories
CMS Drupal Mastering Development

How to include external libraries placed outside the webroot in a custom module?

I’d like to use an external library in my custom module. So, I added it as a dependency in the composer.json of my custom module. Since the drupal/recommended-project template places the vendor/ directory outside the webroot, we can’t access it directly from the .libraries.yml file like this: chosen: js: /vendor/harvesthq/chosen/chosen.jquery.min.js: {} According to this Jaypan’s […]

Categories
CMS Drupal Mastering Development

How to include external libraries placed outside the webroot in a custom module?

I’d like to use an external library in my custom module. So, I added it as a dependency in the composer.json of my custom module. Since the drupal/recommended-project template places the vendor/ directory outside the webroot, we can’t access it directly from the .libraries.yml file like this: chosen: js: /vendor/harvesthq/chosen/chosen.jquery.min.js: {} According to this Jaypan’s […]