Extend templates from outside templates directory I have a setup where I'm using a component library that I have as an npm package. To use these components I need to extend templates that live outside of the /templates directory. So I need to achieve something like:

{% extends "../../../../node_modules/design-system/page-templates/_template.njk" %}

I will be extended from within a template that is located from within the /templates directory but allows for extends from outside of it.

Any help would be great.
You need to define and register your template roots for this folder:

Event::on(
    View::class,
    View::EVENT_REGISTER_SITE_TEMPLATE_ROOTS,
    function(RegisterTemplateRootsEvent $e) {{
        $e-&gt;roots['my-fancy-prefix'] = 'someDir';
    }
);