What is the equivalent of Drupal.settings.basePath?
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(),
  ];

  ...