javascript - Populate 'files' property of Grunt task configuration via function -


edited:

is there way dynamically populate src files 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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -