Grunt не обновляет основной файл scss
У меня есть проект, который использует GruntJS с grunt-contrib-sass, grunt-contrib-watch и grunt-newer.
Мой основной файл app.scss импортирует несколько файлов .scss с директивой @import, например
@import "common / vars.scss";
Если я внесу изменения в основной app.scss, все работает. Проблема в том, что когда я делаю изменения в импортируемом файле (например, vars.scss), app.scss не обновляется.
Это моя задача часов:
watch: {
css: {
files: ['scss/**/*.scss'],
tasks: ['newer:sass'],
options: {
spawn: false,
}
}
}
И это сама задача sass:
sass: {
dist: {
options: {
style: 'compressed',
noCache: true
},
/* looks for every .scss file in the scss folder (checks nested folders too),
* compile it and create another file wit the same name in the style folder */
files: [{
expand: true,
cwd: 'scss',
src: ['**/*.scss'],
dest: 'style',
rename: function (dest, src) {
var folder = src.substring(0, src.lastIndexOf('/'));
var filename = src.substring(src.lastIndexOf('/'), src.length);
filename = filename.substring(0, filename.lastIndexOf('.'));
return dest + '/' + folder + filename + '.css';
}
}]
}
}
Любая идея, как изменить Gruntfile.js, чтобы охватить этот сценарий тоже? :) Спасибо.