Last active
August 29, 2015 14:14
-
-
Save KingScooty/ffa08f15ab087d84d79d to your computer and use it in GitHub Desktop.
Using Grunt Assemble in Gulp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
assemble: { | |
options: { | |
partials: ['./app/templates/partials/**/*.hbs'], | |
layout: ['./app/templates/layouts/default.hbs'], | |
data: ['./app/data/*.json'], | |
helpers: ['./build-pipeline/_helpers/helper-*.js'] | |
}, | |
site: { | |
files: [ | |
{ | |
expand: true, | |
cwd: "./app/templates/pages/", | |
src: "**/*.hbs", | |
dest: "app/compiled/", | |
ext: ".html" | |
} | |
] | |
} | |
} | |
}); | |
grunt.loadNpmTasks("assemble"); | |
return grunt.registerTask('grunt-assemble', ['assemble']); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var assemble = require('gulp-assemble'); | |
var browserSync = require('browser-sync'); | |
require('gulp-grunt')(gulp); | |
// Static server | |
gulp.task('browser-sync', function() { | |
browserSync({ | |
server: { | |
baseDir: "./app/" | |
} | |
}); | |
}); | |
gulp.task('assemble-watch', ['grunt-assemble'], function() { | |
gulp.watch("app/templates/**/*.hbs", ['grunt-assemble', browserSync.reload]); | |
}); | |
gulp.task('watch', ['assemble-watch', 'browser-sync']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment