我正在尝试在grunt-contrib-compass
任务中添加对watch
的调用,但它没有注册任何已保存的.scss文件更改。 grunt compass
工作正常,grunt watch
按预期记录* .php的所有其他更改。那个人在这里做错了什么?
gruntfile.js:
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.initConfig({
compass: {
dev: {
options: {
config: 'config.rb'
} //options
} //dev
}, //compass
watch: {
options: { livereload: true },
scripts: {
files: ['/scripts/*.js'],
}, //scripts
sass: {
files: ['/_sass/*.scss'],
tasks: ['compass:dev']
}, //sass
html: {
files: ['*.php']
} //html
} //watch
}) //initConfig
grunt.registerTask('default', 'watch');
} //exports
只是为了踢,我的config.rb:
css_dir = '/css'
sass_dir = '/_sass'
output_style = :nested
答案 0 :(得分:0)
您的领导' /'在你所有的路径中都把你抛弃,删除它们(都来自gruntfile和config.rb):
watch: {
options: { livereload: true },
scripts: {
files: ['scripts/*.js'],
}, //scripts
sass: {
files: ['_sass/*.scss'],
tasks: ['compass:dev']
}, //sass
html: {
files: ['*.php']
} //html
} //watch