javascript - grunt watch tasks no response after running -
i have problem when run "grunt" in terminal, after changes in ".scss" file nothing happens, terminal still waitting..... here gruntfile.js file:
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']); };
and terminal this:
use config variable avoid problem. example:
var appconfigvars = { sass: 'static/sass' }; grunt.initconfig({ appconfig: appconfigvars, watch:{ sass:{ files: '<%= appconfig.sass %>**/*.scss', tasks:['sass'] } } });
Comments
Post a Comment