Skip to content

Instantly share code, notes, and snippets.

@KingScooty
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save KingScooty/ffa08f15ab087d84d79d to your computer and use it in GitHub Desktop.

Select an option

Save KingScooty/ffa08f15ab087d84d79d to your computer and use it in GitHub Desktop.

Revisions

  1. KingScooty revised this gist Jan 31, 2015. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions gulpfile.js
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,17 @@ 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']);
  2. KingScooty created this gist Jan 31, 2015.
    25 changes: 25 additions & 0 deletions Gruntfile.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    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']);
    };
    9 changes: 9 additions & 0 deletions gulpfile.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    var gulp = require('gulp');
    var assemble = require('gulp-assemble');
    var browserSync = require('browser-sync');

    require('gulp-grunt')(gulp);

    gulp.task('assemble-watch', ['grunt-assemble'], function() {
    gulp.watch("app/templates/**/*.hbs", ['grunt-assemble', browserSync.reload]);
    });