Grunt花了相當長的時間來編譯css文件,我不確定這是否正常,但是普通的指南針手錶大約需要5秒。Grunt with Compass and Watch compiles slow
所以問題是,如果有什麼辦法可以加快Grunt的編譯時間,還是更好地堅持羅盤觀看?
Running "compass:dist" (compass) task
♀unchanged images/sprite-sf580a96666.png
overwrite stylesheets/app.css (3.263s)
unchanged images/sprite-sf580a96666.png
overwrite stylesheets/app_fr.css (3.289s)
Compilation took 11.116s
Running "watch" task
Completed in 13.974s at Wed Dec 18 2013 13:53:05 GMT-0500 (Eastern Standard Time- Waiting...
OK
>> File "scss\_core.scss" changed.
Gruntfile.js:
compass: {
dist: {
options: {
config: 'config.rb'
}
}
},
watch: {
sass: {
files: ['scss/*.scss'],
tasks: ['compass:dist'],
options: {
spawn: false,
}
},
scripts: {
files: ['js/*.js'],
tasks: ['concat', 'uglify'],
options: {
spawn: false,
}
}
}
});
雖然這適用於重新加載更改的客戶端文件,但如果您的watch任務中包含Expressj,則無法重新加載expressjs。 – gerasalus
@gerasalus我認爲你需要添加'livereload:true'作爲'watch'任務的一個選項。請參閱https://github.com/gruntjs/grunt-contrib-watch#optionslivereload。 –