Problem/Motivation

Many projects make use of custom Twig extensions. It might be useful or required to be able to use them in Twig component templates too.

Proposed resolution

Attached patch adds an alter hook to modify the Twig environment used in SSR. NB The client-side twig.js environment would need to be extended with the same extensions used in the SSR environment. (see https://github.com/twigjs/twig.js/wiki/Extending-twig.js). This could be done in Twig component's js file (likely importing a common extensions.js file or similar).

Comments

bgilhome created an issue.