javascript - load-grunt-config not finding target task -


i want split large gruntfile in smaller pieces , came these articles: https://github.com/firstandthird/load-grunt-config http://ericnish.io/blog/how-to-neatly-separate-grunt-files/ however, seems i'm missing obvious. when issue "grunt testtask" task not found. i'm doing wrong, obviously, don't it. here's content of files, stripped down as possible:

gruntfile.js: module.exports = function(grunt) {  var path = require('path');   require('load-grunt-config')(grunt, {     configpath: path.join(process.cwd(), 'grunt3'),         init: true   }); };  grunt3/testtask.js: module.exports = {   copy: {     main:        {         files:          [{            src:  "test1.txt",            dest: "test2.txt"         }]     }   } };  added aliases file: module.exports = {   'default': [],   'mytesttask': [     'testtask'   ] }; 

default found. mytesttalk "testtask not found". shouldn't aliases.js registertask either filename (testtask) or "copy" (i tried using 'copy' target task)? there config object named "testtask" according --config-debug. missing here?

thanks.

addendum: found simple , straight-forward article on same subject shows how simplify further. just, again, it's not working. task specified in aliases not found. e.g. 'mytesttask': [ 'testtask'] -> testtask not found, although there grunt/testtask.js file contains task original gruntfile. missing?

with of excellent article http://mattbailey.io/a-beginners-guide-to-grunt-redux.html , 1 of authors of module commenting on github found flaw in thinking. files not organized tasks or targets grunt modules. so, you have name them copy.js (from grunt-contrib-copy), cssmin.js (from grunt-contrib-cssmin), concat.js (from grunt-contrib-concat) und put various targets in these files. not other way around (as thought). maybe that's clear others documentation, wasn't me. article matt bailey great shows necessary. article eric nishio referenced above unnecessarily complex doesn't account aliases file.


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -