tde/twig-webpack-manifest

Injects CSS/JS in HTML templates, based on the generated Webpack manifest.json

This package's canonical repository appears to be gone and the package has been frozen as a result.

v1.0.2 2017-11-20 15:52 UTC

This package is auto-updated.

Last update: 2023-12-19 08:12:31 UTC


README

Introduction

Injects CSS/JS in HTML templates, based on the generated Webpack manifest.json

Instalation

The easiest way to install GTwig Webpack manifest is through Composer.

composer require tde/twig-webpack-manifest

Requirements

Basic usage

$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>

Maintainers

TDE.nl - We craft digital connections in sports