-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgruntfile.js
41 lines (36 loc) · 1.08 KB
/
gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Create the html files from page layouts and partial html fragments
copy: {
dist: {
files: [{dest: 'dist/', src: '**', expand: true, cwd: 'src/static/'}]
}
},
assemble: {
options: {
assets: 'dist/',
layout: 'src/layouts/layout.hbs',
partials: ['src/partials/*.hbs'],
helpers: ['src/helpers/*'],
data: 'src/data/*.json'
},
pages: {
files:[{expand: true, cwd: 'src/pages/', src: '**/*.hbs', dest: 'dist', ext: '.html'}]
}
},
// Watch JS, LESS & HTML files for changes, copy & compile but not minify for easy debug during dev
watch: {
project: {
options: {livereload: true},
files: 'src/**',
tasks: ['copy', 'assemble']
}
}
});
grunt.loadNpmTasks('assemble');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['copy', 'assemble']);
};