c0rrupt / gulp-twig-compile

Compiles Twig Templates to Javascript using Twig.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gulp-twig-compile

Build Status dependencies

NPM info

Information

Packagegulp-twig-compile
Description Compiles Twig Templates to Javascript using [Twig.js](https://github.com/justjohn/twig.js)
Node Version >= 0.9

Installation

npm install --save gulp-twig-compile

Usage

var twig_compile = require('gulp-twig-compile');

gulp.task('twig', function() {
  gulp.src('./src/**/*.twig')
    .pipe(twig_compile())
    .pipe(gulp.dest('./dest/'))
});

Options

The options object supports the module and twig options for the Twig compiler.

  • module
    Should the output be written in module format. Supported formats:
    • node: Node.js / CommonJS 1.1 modules
    • amd: RequireJS / Asynchronous modules (requires twig)
    • cjs2: CommonJS 2.0 draft8 modules (requires twig)
  • twig
    Used with module. The location relative to the output directory of twig.js. (used for module dependency resolution).
var twig_compile = require('gulp-twig-compile');

gulp.task('twig', function() {
  gulp.src('./src/**/*.twig')
    .pipe(twig_compile({module: 'amd', twig: 'lib/twig'}))
    .pipe(gulp.dest('./dest/'))
});

About

Compiles Twig Templates to Javascript using Twig.js

License:MIT License


Languages

Language:JavaScript 100.0%