Theme path in javascript I need to use my theme path in a jQuery script for a D8 theme I'm building. I know this is available as drupalSettings.path.baseURL (followed by the path to my theme) but how do you make this variable available to javascript? Lots of D7 info out there, not much D8.
You can attach the drupalSettings in any form / build / preprocess etc.

Something like : 

function HOOK_preprocess_html(&amp;$variables) {
 $variables['#attached']['drupalSettings']['path']['themeUrl'] = \Drupal::theme()-&gt;getActiveTheme()-&gt;getPath();
}