簡體   English   中英

慢咕unt手表

[英]Slow grunt watch

我已經在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']); } 

如果我發脾氣,一切都會很好,但是非常慢。 完成三個任務最多需要15秒:

慢咕unt

我做錯了什么嗎?

最初取自: https : //github.com/gruntjs/grunt-contrib-watch/issues/69

默認情況下,此監視任務將生成作為子進程運行的任務。 對於某些系統,尤其是在Windows上,它可能確實很慢。 設置選項: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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM