javascript - Populate 'files' property of Grunt task configuration via function -
edited:
is there way dynamically populate srcfiles property of task configuration in grunt via function?
example
concat: { angularsourcejs: { src: function() { return angularsort(grunt.file.expand('src/**/*.js')); }, dest: 'dist/site.js' } } karma: { unit: { files: function() { return angularsort(grunt.file.expand('src/**/*.js')); }, ... } } this helpful in situations like this, order of files matters defining order far more complex changing order in array. utilizing grunt-contrib-watch not desired reload grunt.
you can do:
concat: { angularsourcejs: { src: angularsort(grunt.file.expand('src/**/*.js')), dest: 'dist/site.js' } } above assumes, angularsort function returns array of sorted file paths.
Comments
Post a Comment