gpt4 book ai didi

javascript - 慢咕噜 watch

转载 作者:太空宇宙 更新时间:2023-11-04 02:18:21 24 4
gpt4 key购买 nike

我已经在 Windows 7 Professional 系统上设置了一个简单的 grunt 环境。这是我创建的 gruntfile.js:

module.exports = function(grunt) {

grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-sftp-deploy');

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
'sftp-deploy': {
build: {
auth: {
host: '',
port: 22,
authKey: ''
},
cache: 'sftpCache.json',
src: '/css',
dest: '/public_html/css',
exclusions: ['/css/**/.DS_Store', '/css/**/Thumbs.db', 'dist/tmp', '/css/dev', '/css/*.map'],
serverSep: '/',
localSep: '/',
concurrency: 4,
progress: true
}
},
compass: {
dist: {
options: {
sassDir: '/css/dev',
cssDir: '/css',
environment: 'production'
}
},
dev: {
options: {
sassDir: '/css/dev',
cssDir: '/css'
}
}
},
watch: {
css: {
files: '**/*.scss',
tasks: ['compass:dev']
},
ftp: {
files: 'css/*.css',
tasks: ['sftp-deploy']
}
}
});

grunt.registerTask('default',['watch']);

}

如果我启动 grunt,一切都会正常,但速度很慢。完成这三项任务最多需要 15 秒:

slow grunt

我是不是做错了什么?

最佳答案

原文摘自: https://github.com/gruntjs/grunt-contrib-watch/issues/69

By default this watch task will spawn task runs as child processes. For some systems, especially on Windows it can be really slow. Set the option: nospawn: true.

https://github.com/gruntjs/grunt-contrib-watch#optionsnospawn https://github.com/gruntjs/grunt-contrib-watch#why-spawn-as-child-processes-as-a-default

关于javascript - 慢咕噜 watch ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34725974/

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