1.0.3 • Published 7 years ago

gulp-commonjs-soy v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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

1.0.3

7 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago