gpt4 book ai didi

performance - 与Compass和Watch一起 Grunt 咕slow的编译速度很慢

转载 作者:行者123 更新时间:2023-12-04 01:54:57 25 4
gpt4 key购买 nike

Grunt需要很长时间来编译css文件,我不确定这是否正常,但是常规的指南针 watch 大约需要5秒钟。

所以问题是,是否有任何方法可以使用Grunt加快编译时间,还是只坚持使用指南针 watch 更好?

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,
}
}
}

});

最佳答案

连同Simon关于grunt-contrib-compass的watch选项提到的内容,您可以使用grunt-concurrent来同时运行两个进程,即grunt watchcompass watch:

concurrent: {
watch: {
tasks: ['watch', 'compass:watch'],
options: {
logConcurrentOutput: true
}
}
},
compass: {
watch: {
options: {
watch: true
}
}
}

如果要在构建,部署或需要 compile而不是 watch的其他任何操作时从Grunt运行指南针,则需要执行第二个指南针任务并使用该指南针:

compass: {
// Compass grunt module requires a named target property with options.
compile: {
options: {}
}
}

关于performance - 与Compass和Watch一起 Grunt 咕slow的编译速度很慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20666237/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com