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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Webpack loader for compiling Twig.js templates. This loader will allow you to require Twig.js views to your code.
r current specific version
install git+ssh://git@github.com/ibrows/twig-loader.git#ae947e74d4d91797f0ef57df613baa4882cfe0a7 --save-dev
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;
}
}
}
},
],
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.
embed
supportimport
support (https://github.com/zimmo-be/twig-loader/pull/8).twig
file extension. After upgrading twig-loader, you may need to update your files and add .twig
manually