Access Drupal globals in Twig
These variables are not available to template files, but you can easily add it to every template file by implementing hooks.

You need to prepare variable for twig files. To use the global variables in twig files you need to set it.

Prepares variables for the page template:

You will get details  template_preprocess_page.

function template_preprocess_page(&amp;$variables) {
  $variables['base_path'] = base_path();
}