grunt-flats
Version:
Grunt task for generating static layouts from templated partials.
48 lines (37 loc) • 1.14 kB
JavaScript
/*
* grunt-flats
* https://github.com/adamduncan/grunt-flats
*
* Copyright (c) 2014 Adam Duncan
* Licensed under the MIT license.
*/
;
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// grunt-contrib-clean
// Remove generated templates from destination folder
// Be sure not to remove master template if saved in base directory
clean: {
build: ['<%= flats.build.options.destPath %>/*.html', '!<%= flats.build.options.basePath %>/<%= flats.build.options.masterSrc %>']
},
// grunt-flats
flats: {
build: {
options: {
basePath: '_templates',
layoutPath: 'layouts',
partialPath: 'partials',
masterSrc: 'masterpage/master.html',
destPath: '_templates'
}
}
}
});
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-clean');
// By default, lint and run all tests.
grunt.registerTask('default', ['clean', 'flats']);
};