だから私はGulp
Sass
(gulp-changed
更新された構文の変更でgulp-newerも試しました)scss
使用し、フォルダー内のすべてのファイルを監視しています。
ベースscss
ファイルを変更すると、問題なくコンパイルされます。
ただし、パーシャルを変更すると、そのパーシャルに依存する sass ファイルはコンパイルされません。
ゴクゴク
var SRC = './stylesheets/**/*.scss';
var DEST = './stylesheets';
gulp.task('sass', function() {
return gulp.src(SRC)
.pipe(changed(DEST, { extension: '.css' }))
.pipe(plumber({
errorHandler: handleErrors
}))
.pipe(sourcemaps.init())
.pipe(sass({
includePaths: [
'C:/var/www/mobile 2/stylesheets'
]}))
.pipe(sourcemaps.write('./'))
.on('error', handleErrors)
.pipe(gulp.dest(DEST))
});
フォルダ
├── scss
│ └── base.scss
│ ├── _partial1.scss
│ └── _partial2.scss
│ └── anotherBase.scss
│ ├── _anotherBasePartial1.scss
│ └── _anotherBasePartial2.scss
行われた変更にbase.scss || anotherBase.scss
変更を加える、何も変更しpartial1.scss
ない。
ログでわかるように:
[15:14:02] Starting 'sass'... //here i changed _partial1.scss
[15:14:03] Finished 'sass' after 248 ms
[15:18:20] Starting 'sass'...
[15:18:20] Finished 'sass' after 289 ms
[BS] File changed: c:\var\www\mobile 2\stylesheets\sitescss\responsive\tools\base.css
[15:18:24] Starting 'sass'...
[15:18:24] Finished 'sass' after 289 ms
[BS] File changed: c:\var\www\mobile 2\stylesheets\sitescss\responsive\tools\anotherBase.css
パーシャルが変更されるたびにscssをコンパイルしたいと思います。