gulp-commonjs-soy
v1.0.3
Published
Compile Closure/Soy Templates and convert to CommonJs via Gulp
Downloads
2
Readme
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 torequire
s (defaults to__dirname
).
License
MIT