What is the equivalent of Drupal.settings.basePath? I'm trying to get the site URL in JavaScript. In Drupal 7, this is stored in Drupal.settings.basePath. What's the Drupal 8 equivalent?
In Drupal 8 this setting is:

drupalSettings.path.baseUrl


You find more in core/module/system/system.module:

function system_js_settings_alter(&amp;$settings, AttachedAssetsInterface $assets) {
  ...
    $path_settings = [
    'baseUrl' =&gt; $request-&gt;getBaseUrl() . '/',
    'pathPrefix' =&gt; $pathPrefix,
    'currentPath' =&gt; $current_path,
    'currentPathIsAdmin' =&gt; $current_path_is_admin,
    'isFront' =&gt; \Drupal::service('path.matcher')-&gt;isFrontPage(),
    'currentLanguage' =&gt; \Drupal::languageManager()-&gt;getCurrentLanguage(LanguageInterface::TYPE_URL)-&gt;getId(),
  ];

  ...