How can I overidde html.html.twig in a module? I have an application that is two parts: a website front-end and a restful back-end I can do with AngularJS.
The restful part is done by a module and I need to override html.html.twig.

How do I achieve this?
Overriding templates in the modules is not suggested because Drupals architecture doesn't really support multiple modules overriding same template.

However if you are still willing to do this, you have to simply add hook_theme() like this in your module file:

/**
 * Implements hook_theme().
 */
function modulename_theme() {
  return [
    // Normally theme suggestion templates are only picked up when they are in
    // themes. We explicitly define theme suggestions here so that these
    // templates in this module are picked.
    'html' =&gt; array(
    'render element' =&gt; 'elements',
    'base hook' =&gt; 'html',
  ];
}


Note: This will cause error messages in case you don't have the html.html.twig template available in the templates folder.