Skip to content

qur2/twig-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twig-loader Build Status

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

Usage

Documentation: Using loaders

var template = require("twig!dialog.html.twig");
// => returns pre-compiled template as a function and automatically includes Twig.js to your project

var html = template({title: 'dialog title'});
// => Render the view with the given context

When you extend another view, it will also be added as a dependency. Include and Import are not yet supported (check back soon).

Changelog

0.2.0 / 2016-01-21

  • Add support for import statements (useful for Macro's)
  • Correctly resolve dependencies from include/import/extend statements with relative path support: [#3] and [#5]
  • CHANGE: No longer add the .twig file extension. After upgrading twig-loader, you may need to update your files and add .twig manually

About

Webpack loader for compiling Twig.js templates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%