标签:
module.exports = function (grunt){
// laod all grunt tasks automatically
require(‘load-grunt-tasks‘)(grunt);
// time how long grunt task take, can help when optimizing build times
require(‘time-grunt‘)(grunt);
// configure grunt
grunt.initConfig({
// the actual grunt server settings
connect: {
options: {
port: 9000,
hostname: ‘localhost‘,
//keepalive: true
livereload: 35729
},
all: {
options: {
open: true,
base: [‘./‘] // index.html directory
}
}
},
// watch files for changes, and run tasks base on the changed files
watch: {
livereload: {
options: {
// this port must be same with the connect livereload port
livereload: ‘<%= connect.options.livereload %>‘
},
// watch whatever files you needed.
files: [
‘./*.html‘,
‘./app/styles/*.css‘,
‘./app/js/(,*/)*.js‘,
‘./app/images/(,*/)*.{png,jpg,gif}‘/
]
}
}
});
// creates the server task
grunt.registerTask(‘serve‘, [‘connect:all‘, ‘watch‘]);
}
标签:
原文地址:http://www.cnblogs.com/walle2/p/4926377.html