added grunt-includes, and seprated html files
This commit is contained in:
32
Gruntfile.js
32
Gruntfile.js
@@ -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'
|
||||
]);
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user