This is a follow up to Define JavaScript library in Drupal 8
I have a third party library that I don't want to bundle with a module. In Drupal 7 I could just ask the user to extract to sites/all/libraries
what is the best practice in Drupal 8?
This is a follow up to Define JavaScript library in Drupal 8
I have a third party library that I don't want to bundle with a module. In Drupal 7 I could just ask the user to extract to sites/all/libraries
what is the best practice in Drupal 8?
One option is to do it exactly like in D7. Put it in /libraries or /sites/all/libraries and use the libraries module to detect the location.
location.module itself unfortunately doesn't work that well in 8.x yet, so you have to define an 8.x-1.x library and then use the libraries API to get the location and dynamically alter. Or I guess you could also do that part yourself.
I'm doing that in the JW Player project, see jw_player_libraries_info() + jw_player_library_info_alter(). It unfortunately still requires a bit of code, maybe that will improve in the future when libraries.module works better in 8.x.
If we follow what symfony2 uses, we have to use then: /vendor/libraryname/lib/Libraryname/src/libraryname.js