我是新来的帆。我在用着:
- 帆@0.10.5
- grunt-contrib-watch@0.5.3
- grunt-contrib-jshint@0.10.0
- jshint@2.5.11
我一直在使用sails lift
或启动我的服务器sails lift --verbose
。根据风帆文件grunt default
运行。第一个任务是compileAssets
。以jshint
. 我的compileAssets
任务以watch
命令结束。
当正在监视的文件发生更改时,syncAssets
将运行。syncAssets
与我的compileAssets
任务相同。它们都以jshint
.
问题是,在syncAssets
运行时,它没有jshint
在控制台中报告任何错误,和/或停止syncAssets
任务,所以我不知道我的代码是否在不查看源代码的情况下编译。
然后我必须重新启动服务器才能找到错误,因为compileAssets
会打印jshint
错误。
我的任务中是否配置错误?
tasks/register/default.js -- 不变
module.exports = function (grunt) {
grunt.registerTask('default', ['compileAssets', 'linkAssets', 'watch']);
};
任务/注册/syncAssets.js
module.exports = function (grunt) {
grunt.registerTask('syncAssets', [
'jshint',
'bower',
'clean:dev',
'copy:dev',
'exec:compileTemplates',
'exec:compilePartials',
'compass'
]);
};
任务/注册/compileAssets.js
module.exports = function (grunt) {
grunt.registerTask('compileAssets', [
'jshint',
'bower',
'clean:dev',
'copy:dev',
'exec:compileTemplates',
'exec:compilePartials',
'compass'
]);
};