Answers.Body: <p>It's both. One of the main issues with civicrm+drupal8 is that drupal 8 (correctly) doesn't allow web access to files in the vendor folder, since that can be a security issue. Both roundearth and civicrm-asset-plugin try to deal with it, just a bit differently, by copying the files to a web-accessible folder, via composer events that are triggered when you run composer.</p>
  
  <p>It doesn't copy all files, just the ones needed. It is possible for them to get out of sync if for whatever reason the composer event doesn't trigger, but you can re-sync by deleting the one under /web/libraries and running <code>composer install</code> again. You may need to delete one the /vendor bower_components subfolders to get that to trigger it. I never know what composer is really looking at when it decides what to do.</p>
  
  <p>UPDATE: If you're using the civicrm/civicrm-asset-plugin (as opposed to roundearth), running <code>composer civicrm:publish</code> from the top folder (above vendor) will re-sync the appropriate files from vendor to web. For roundearth, I haven't tested this but it might work to use <code>composer civicrm:sync-web-assets</code>, also from the top folder.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-27T15:04:30.417Z
Answers.Text: I tried deleting both and running composer install again, but it failed to create the bower_components under /web/libraries/civicrm/.
Answers.UserDisplayName: Stephen Palmstrom
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-27T15:15:29.323Z
Answers.Text: Argh, composer. It might need something bigger to trigger the plugin, like removing vendor/civicrm/civicrm-core and then running `composer install` again. On the plus side that should install from cache so should be quick. (If anything with composer could be called quick - let's go with "not too slow".)
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-20T16:58:06.573Z
Answers.LastActivityDate: 2020-04-27T17:05:26.893Z
Answers.LastEditDate: 2020-04-27T17:05:26.893Z
Answers.UserDisplayName: Demerit
Body: <p>I am running a couple of test sites under Drupal 8, installing them using Composer.  Bower_components seem to be living in two places.</p>
  
  <p>/vendor/civicrm/civicrm-core/bower_components/</p>
  
  <p>and</p>
  
  <p>/web/libraries/civicrm/bower_components/</p>
  
  <p>Which is the 'right' one, or is there an issue where files are duplicated?</p>
  
Tags: <drupal-8>
Title: Where should bower_components reside under Drupal 8
ThreadText: # Where should bower_components reside under Drupal 8
  
  (Asked by: username_0 on 2020-04-20)
  
  I am running a couple of test sites under Drupal 8, installing them using Composer. Bower\_components seem to be living in two places.
  
  /vendor/civicrm/civicrm-core/bower\_components/
  
  and
  
  /web/libraries/civicrm/bower\_components/
  
  Which is the 'right' one, or is there an issue where files are duplicated?
  
  **Tags:** drupal-8
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-04-20. Score: 2
  
  It's both. One of the main issues with civicrm+drupal8 is that drupal 8 (correctly) doesn't allow web access to files in the vendor folder, since that can be a security issue. Both roundearth and civicrm-asset-plugin try to deal with it, just a bit differently, by copying the files to a web-accessible folder, via composer events that are triggered when you run composer.
  
  It doesn't copy all files, just the ones needed. It is possible for them to get out of sync if for whatever reason the composer event doesn't trigger, but you can re-sync by deleting the one under /web/libraries and running `composer install` again. You may need to delete one the /vendor bower\_components subfolders to get that to trigger it. I never know what composer is really looking at when it decides what to do.
  
  UPDATE: If you're using the civicrm/civicrm-asset-plugin (as opposed to roundearth), running `composer civicrm:publish` from the top folder (above vendor) will re-sync the appropriate files from vendor to web. For roundearth, I haven't tested this but it might work to use `composer civicrm:sync-web-assets`, also from the top folder.
  
  > **Comments:**
  > **username_0**: I tried deleting both and running composer install again, but it failed to create the bower_components under /web/libraries/civicrm/.  
  > **username_1**: Argh, composer. It might need something bigger to trigger the plugin, like removing vendor/civicrm/civicrm-core and then running `composer install` again. On the plus side that should install from cache so should be quick. (If anything with composer could be called quick - let's go with "not too slow".)  
  
  ---
  
  