【发布时间】:2016-02-15 09:51:52
【问题描述】:
这应该很简单,但是我花了好几个小时却没有完成这项工作,
我只需要在更新服务器代码时重新加载服务器,并在更新客户端代码时重新加载浏览器。
这是我的代码,
请帮我找出问题所在,
var path = require('path');
module.exports = function(grunt) {
grunt.initConfig({
express: {
options: {
port: 3000,
open:'http://localhost:3000',
hostname:'localhost',
server: path.resolve('./app.js'),
serverreload:true
},
load: {
server: path.resolve('./app.js')
}
},
watch: {
express: {
files: ['*/**'],
tasks: ['express:load']
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-express');
grunt.registerTask('server', ['express:load', 'express-keepalive', 'watch']);
};
【问题讨论】:
标签: gruntjs grunt-contrib-watch