Commit 96b4f2c1 authored by Stefan Auditor's avatar Stefan Auditor Committed by Lee Rowlands
Browse files

Issue #3292015 by sanduhrs: Allow dependency management via asset-packagist

parent 93c8d32c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -41,6 +41,12 @@ function _a11y_autocomplete_element_find_library(): string {
  if (file_exists($git_clone)) {
    return base_path() . 'libraries/a11y_autocomplete/src/a11y.autocomplete.js';
  }

  $asset_packagist = DRUPAL_ROOT . '/libraries/drupal--autocomplete/dist/a11y.autocomplete.min.js';
  if (file_exists($asset_packagist)) {
    return base_path() . 'libraries/drupal--autocomplete/dist/a11y.autocomplete.min.js';
  }

  $npm_install = dirname(DRUPAL_ROOT) . '/node_modules/@drupal/autocomplete/dist/a11y.autocomplete.min.js';
  if (file_exists($npm_install)) {
    // We copy the files inside Drupal so they can still be served when using