gulp-commonjs-soy

1.0.3 • Public • Published

gulp-commonjs-soy

Compile Closure/Soy Templates and convert to CommonJs via Gulp.

Example

var gulp = require('gulp');
var soy = require('gulp-commonjs-soy');
 
gulp.task('compile-soy', function() {
  return gulp.src('public/templates/**/*.soy')
    .pipe(soy({
      root: __dirname + '/public/templates'
    })
    .pipe(gulp.dest('build/public/js/templates'));
});

The above example will compile Soy templates (in public/templates), convert to commonjs via commonjs-soy, and output to build/public/js/templates as a commonjs module (with a .js extension). You can then pass them through browserify or some other packager for use in the browser.

Options

  • Setting root defines the path for {call...}s that need to be converted to requires (defaults to __dirname).

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i gulp-commonjs-soy

Weekly Downloads

1

Version

1.0.3

License

MIT

Last publish

Collaborators

  • mattpowell