Injects CSS/JS in HTML templates, based on the generated Webpack manifest.json
The easiest way to install GTwig Webpack manifest is through Composer.
composer require tde/twig-webpack-manifest
$twig = new Twig_Environment($loader);
$twig->addExtension(new \TDE\TwigWebpackManifestExtension\WebpackExtension(
__DIR__ . '/public/assets/manifest.json'
));
{# base.html.twig #}
<!DOCTYPE html>
<html>
<head>
{# ... #}
{% webpack_css 'app.css' %}
</head>
<body>
{# ... #}
{% webpack_js 'vendor.js' %}
{% webpack_js 'app.js' %}
</body>
</html>
TDE.nl - We craft digital connections in sports