我使用的是一个超级简单的grunt文件,它监视并编译我的sass文件,然后使用chrome扩展加载页面。
这一切都工作得很好,但我也想在进行更改和保存时观察html文件和liverload中的更改。
有人能告诉我为什么这个不起作用吗?
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Sass processing
sass: {
dist: {
files: {
"css/styles.css": "css/scss/styles.scss"
}
}
},
// Growl notifications
notify: {
full: {
options: {
message: 'Project compiled'
}
},
sass: {
options: {
message: 'Sass compiled'
}
},
html: {
options: {
message: 'html updated'
}
}
},
// File Watcher
watch: {
sass: {
files: ['css/scss/*.scss'],
tasks: ['sass', 'notify:sass'],
options:{
livereload: true
}
},
html: {
files: ['index.html','**/*.html','**/*.css'],
tasks: ['notify:html'],
options:{
livereload: true
}
}
}
});
// Default task(s).
grunt.registerTask('default', ['watch']);
};发布于 2014-08-30 23:27:02
解决了这个问题。html手表应该在sass手表之前出现。
https://stackoverflow.com/questions/25582392
复制相似问题