gruntjs - Grunt Multitask configuration issues -
i'm trying configure grunt file can run multiple tasks on multiple "themes". since i'm new whole grunt thing, i'm having problems configuration.
my example below start, i'd have global configs, , nest specific "theme" configurations within named "target". i'm not speed on syntax, issue, when run grunt powerful
error warning: required config property "watch" missing? feel configs ok, problem lies registermultitask
. ideas?
module.exports = function(grunt) { // project configuration. grunt.initconfig({ // metadata. pkg: grunt.file.readjson('package.json'), banner: '/*!\n' + '* microsites v<%= pkg.version %>\n' + '* copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' + '*/\n' + '/* @package: <%= pkg.name %> */\n', jquerycheck: 'if (!jquery) { throw new error(\"<%= pkg.name %> requires jquery\") }\n\n', basepath: '../../www/wp-content/themes', powerful: { name: 'powerful theme', path: '<%= basepath %>/powerful', less: { development: { options: { dumplinenumbers: true }, files: { '<%= powerful.path %>/static/css/project.css': '<%= powerful.path %>/static/css/less/project.less', '<%= powerful.path %>/static/css/editor.css': '<%= powerful.path %>/static/css/less/editor.less', '<%= powerful.path %>/static/css/login.css': '<%= powerful.path %>/static/css/less/login.less' } }, production: { options: { yuicompress: true }, files: { '<%= powerful.path %>/static/css/project.css': '<%= powerful.path %>/static/css/less/project.less', '<%= powerful.path %>/static/css/editor.css': '<%= powerful.path %>/static/css/less/editor.less', '<%= powerful.path %>/static/css/login.css': '<%= powerful.path %>/static/css/less/login.less' } }, ie: { options: { yuicompress: true }, files: { '<%= powerful.path %>/static/css/ie.css': '<%= powerful.path %>/static/css/less/ie.less' } } }, watch: { less: { files: ['<%= powerful.path %>/static/css/less/*.less'], tasks: ['less:development'] } } }, // end: powerful }); // load plugin grunt.loadnpmtasks('grunt-contrib-less'); grunt.loadnpmtasks('grunt-contrib-watch'); grunt.loadnpmtasks('grunt-contrib-jshint'); grunt.loadnpmtasks('grunt-contrib-uglify'); grunt.loadnpmtasks('grunt-contrib-concat'); // load tasks //grunt.registertask('default', ['less']); grunt.registermultitask('powerful', 'do things', function(){ grunt.task.run(['watch']); }); };
tasks should go on first level of config, not within task config. powerful
task isnt multitask doesnt need config block. configure tasks standard way:
grunt.initconfig({ less: { /* config here */ }, watch: { /* config here */ } });
Comments
Post a Comment