问题:我将配置绑定监视任务以始终在Visual Studio 2015中运行时遇到问题。
我的目标:我想监视文件中的更改,一旦更改发生,我想运行一些任务,然后恢复监视任务以查找进一步的更改。
到目前为止我尝试过的是:
这是我的gruntfile.js:
/// <binding AfterBuild='default' ProjectOpened='watch' />
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
bower: {
install: {
options: {
targetDir: 'wwwroot/vendor',
layout: 'byComponent',
install: true,
cleanTargetDir: true,
}
}
},
less: {
development: {
files: { 'wwwroot/navbar.css': 'LessStyleSheets/navbar.less' }
}
},
watch: {
options: {
interrupt: true
},
files: ['LessStyleSheets/navbar.less'],
tasks: ['less']
}
});
grunt.registerTask('default', ['bower:install', 'less']);
};
任何帮助将不胜感激。
显然,问题已解决……重新启动Visual Studio之后,问题消失了,运行grunt watch任务后构建过程不再挂起。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句