ibrows/twig-loader

Name: twig-loader

Owner: PwC Experience Center

Description: Webpack loader for compiling Twig.js templates

Created: 2017-06-23 13:34:18.0

Updated: 2017-06-23 13:34:20.0

Pushed: 2017-06-23 15:17:31.0

Homepage: null

Size: 28

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

twig-loader

Webpack loader for compiling Twig.js templates. This loader will allow you to require Twig.js views to your code.

Installation
r current specific version
install git+ssh://git@github.com/ibrows/twig-loader.git#ae947e74d4d91797f0ef57df613baa4882cfe0a7 --save-dev
Usage

Documentation: Using loaders

webpack.config.js

le: {
rules: [
    {
        test: /\.twig$/,
        exclude: /node_modules/,
        loader: `twig-loader`,
        options: {
            extendFilter: {
                trans : function(value) {
                    return value;
                }
            },
            extendFunction: {
                myCustomFunction : function(value) {
                    return value;
                }
            }
        }
    },
],

Loading templates
ile: c-mytwig-component.html.twig #}
{title}}</p>
avascript
rt twigFile from '../c-mytwig-component.html.twig';

t actualMarkupWithArguments = twigfile({
title : 'SuperText',

When you extend another view, it will also be added as a dependency. All twig functions that refer to additional templates are supported: import, include, extends & embed.

Changelog

0.2.4 / 2016-12-29

0.2.3 / 2016-06-11

0.2.2 / 2016-06-03

0.2.1 / 2016-04-18

0.2.0 / 2016-01-21


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.