Skip to content

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

License

Notifications You must be signed in to change notification settings

watcher46/twig-webpack-manifest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twig Webpack manifest

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages