added grunt-includes, and seprated html files

This commit is contained in:
Uvis Grinfelds
2014-11-05 11:55:46 +01:00
committed by Remco
parent e271a5c203
commit dc7543a76b
19 changed files with 1964 additions and 226 deletions

View File

@@ -28,6 +28,10 @@ module.exports = function (grunt) {
gruntfile: {
files: ['Gruntfile.js']
},
includes: {
files: ['<%= yeoman.app %>/*.html', '.tmp/*.html'],
tasks: ['includes:server']
},
livereload: {
options: {
livereload: '<%= connect.options.livereload %>'
@@ -37,7 +41,8 @@ module.exports = function (grunt) {
'{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
'{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
]
],
tasks: ['includes:server']
}
},
connect: {
@@ -112,6 +117,27 @@ module.exports = function (grunt) {
}
}
},
includes: {
build: {
cwd: '<%= yeoman.app %>',
src: ['*.html', 'includes/*.html'],
dest: '<%= yeoman.dist %>',
options: {
flatten: true,
banner: ''
}
},
server: {
cwd: '<%= yeoman.app %>',
src: ['*.html', 'includes/*.html'],
dest: '.tmp/',
options: {
flatten: true,
banner: ''
}
}
},
// not used since Uglify task does concat,
// but still available if needed
/*concat: {
@@ -240,6 +266,7 @@ module.exports = function (grunt) {
grunt.task.run([
'clean:server',
'less',
'includes:server',
'copy:server',
'connect:livereload',
'watch'
@@ -263,6 +290,7 @@ module.exports = function (grunt) {
'copy:server',
'useminPrepare',
'concurrent',
'includes:build',
'cssmin',
'concat',
'uglify',
@@ -275,4 +303,4 @@ module.exports = function (grunt) {
'test',
'build'
]);
};
};