2016-11-05 93 views
0

我有一個問題,當我在終端運行「咕嚕」,我做我的 「.scss」文件沒有一些變化發生時,終端仍然waitting ..... 後沒有響應這裏是我的gruntfile.js文件:咕嚕手錶任務運行

module.exports = function(grunt){ 
    require('load-grunt-tasks')(grunt); 
    grunt.loadNpmTasks('grunt-contrib-jshint'); 
    var config = grunt.file.readYAML('Gruntconfig.yml'); 

    grunt.initConfig({ 
     sass:{ 
      dist:{    
       src: config.scssDir+'style.scss', 
       dest: config.cssDir+'style.css' 
      } 
     }, 
     concat:{ 
      dist:{ 
       src: config.jsSrcDir+'*.js', 
       dest: config.jsConcatDir+'app.js' 
      } 
     }, 
     jshint:{ 
      options:{ 
       "eqeqeq": true 
      }, 
      all:[ 
       'Gruntfile.js', 
       config.jsSrcDir+"*.js" 
      ] 
     }, 
     watch:{ 
      sass:{ 
       files: config.scssDir+'**/*.scss', 
       tasks:['sass'] 
      } 
     } 
    }); 

    grunt.registerTask('default',['jshint', 
     'sass','concat','watch']); 
}; 

和我的終端始終是這樣的:

enter image description here

+1

請從圖像作爲碼的代碼插入到你的信息,而不是插入圖像 – YakovL

+0

是什麼的console.log的'的輸出(config.scssDir +「**/* SCSS。」);' ? –

回答

0

使用配置變量來避免這個問題。例如:

var appConfigVars = { 
    sass: 'static/sass' 
}; 

grunt.initConfig({ 
    appConfig: appConfigVars, 
    watch:{ 
     sass:{ 
      files: '<%= appConfig.sass %>**/*.scss', 
      tasks:['sass'] 
     } 
    } 
});