Skip to content

Commit

Permalink
Separate into two tasks to avoid problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeno Rocha committed Jul 25, 2014
1 parent c508ab9 commit 8517905
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions tasks/build.js
Expand Up @@ -65,9 +65,8 @@ gulp.task('build-javascript', function() {
.pipe(gulp.dest('dist/scripts'));
});

gulp.task('build-templates', function() {
return gulp.src('src/**/*.soy')
.pipe(plugins.plumber(util.logError))
gulp.task('build-templates-root', function() {
return gulp.src(['src/*.soy', 'src/views/*.soy'])
.pipe(plugins.soynode({
loadCompiledTemplates: true,
renderSoyWeb: true
Expand All @@ -76,12 +75,22 @@ gulp.task('build-templates', function() {
.pipe(gulp.dest('dist'));
});

gulp.task('build-templates-examples', function() {
return gulp.src(['src/examples/*.soy', 'src/views/*.soy'])
.pipe(plugins.soynode({
loadCompiledTemplates: true,
renderSoyWeb: true
}))
.pipe(util.buildHtml())
.pipe(gulp.dest('dist/examples'));
});

gulp.task('build-highlight', function () {
return gulp.src('dist/**/*.html')
.pipe(plugins.highlight())
.pipe(gulp.dest('dist'));
});

gulp.task('build', ['clean'], function(cb) {
runSequence(['build-images', 'build-icons', 'build-javascript'], 'build-css', 'build-compass', 'build-html', 'build-templates', 'build-highlight', cb);
runSequence(['build-images', 'build-icons', 'build-javascript'], 'build-css', 'build-compass', 'build-html', 'build-templates-root', 'build-templates-examples', 'build-highlight', cb);
});
2 changes: 1 addition & 1 deletion tasks/watch.js
Expand Up @@ -4,7 +4,7 @@ var gulp = require('gulp');

gulp.task('watch', function() {
gulp.watch('src/**/*.html', ['build-html']);
gulp.watch('src/**/*.soy', ['build-templates']);
gulp.watch('src/**/*.soy', ['build-templates-root', 'build-templates-examples']);
gulp.watch('src/images/**/*.{gif,jpeg,jpg,png,svg}', ['build-images']);
gulp.watch('src/images/icons/*.svg', ['build-icons']);
gulp.watch('src/scripts/**/*.js', ['build-javascript']);
Expand Down

0 comments on commit 8517905

Please sign in to comment.