[英]Grunt watch task binding in Visual Studio 2015
Problem : I have a problem to configure binding for grunt watch task to always run in Visual Studio 2015. 问题 :我有一个问题是为grunt watch任务配置绑定以始终在Visual Studio 2015中运行。
My goal : I want to watch files for changes and once the change occurs I want to run some task and then resume watch task to look for further changes. 我的目标 :我想观察文件的变化,一旦发生变化,我想运行一些任务,然后恢复观察任务以寻找进一步的变化。
What I have tried so far : 到目前为止我尝试了什么 :
Here's my gruntfile.js: 这是我的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']);
};
Any help will be appreciated. 任何帮助将不胜感激。
显然,问题解决了......重新启动Visual Studio后,问题消失,构建过程在运行grunt watch任务后不再挂起。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.