【发布时间】:2016-01-28 20:47:06
【问题描述】:
我试图在我的watch 任务中包含对grunt-contrib-compass 的调用,但它没有注册对我的.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
【问题讨论】:
标签: sass gruntjs grunt-contrib-watch grunt-contrib-compass