0

我有一個簡單的文件很少,內容很少,但編譯時間從10 - 27s不等。任何想法爲什麼?它是我的機器還是我錯過的咕嚕聲?我需要清除某種緩存嗎?咕嚕這麼慢,看多少個任務

Gruntfile.js內容

module.exports = function(grunt) { 

    // Project configuration. 
    grunt.initConfig({ 
    pkg: grunt.file.readJSON('package.json'), 

    less: { 
     development: { 
     options: { 
      paths: ["../css"] 
     }, 
     files: { 
      "../css/main.css": "../less/main.less", 
     } 
     }, 
     bootstrapBuild : { 
     options : { 
      paths: ['../css'] 
     }, 
     files : { 
      "../css/bootstrap.css": "../less/bootstrap.less",   
     } 
     } 
    }, 
    watch: { 
     options: { 
     livereload: true 
     }, 
     markup: { 
      files: ['../*.php', '../inc/*.php'], 
      options: { 
       livereload: true, 
      } 
     }, 
     scripts: { 
     files: ['../js/*.js'], 
     tasks: [], 
     options: { 
      livereload: true, 
      spawn: false 
     }, 
     }, 
     mainCSS: { 
     options: { 
      livereload: false, 
      spawn: false 
     }, 
     files: ['../less/main.less', '../less/responsive/*.less', "../less/common.less"], 
     tasks: ['less:development'] 
     }, 
     bootstrapBuild : { 
     options: { 
      livereload: false, 
      spawn: false 
     }, 
     files: ['../less/*.less', '!../less/main.less', "!../less/common.less"], 
     tasks: ['less:bootstrapBuild'], 
     spawn: false 
     }, 
     css: { 
      files: ['../css/*.css'], 
      tasks: [] 
     } 
    } 
    }); 

    // Less 
    grunt.loadNpmTasks('grunt-contrib-less'); 

    // Watch 
    grunt.loadNpmTasks('grunt-contrib-watch'); 

}; 

的package.json內容

{ 
    "name": "Project-Markup", 
    "version": "0.1.0", 
    "devDependencies": { 
    "grunt": "^0.4.5", 
    "grunt-contrib-nodeunit": "^0.4.1", 
    "grunt-contrib-watch": "^0.6.1", 
    "grunt-contrib-less": "^0.11.4" 
    } 
} 

main.less內容

body{ 
    background: red; 
} 


/* End of Main */ 
+0

我想我已經找到了解決方案,但是您能否發佈更少的結構? –

回答

0

也許它沒有采取這樣的編譯過程很長,但模塊的加載;這是大部分時間的原因。

看看this文章:即使它不能解決你的問題,它可能會給你一個提示什麼是需要這麼久。