MDL-49817 grunt: Refactor the uglify task
authorDan Poltawski <dan@moodle.com>
Thu, 14 Jan 2016 12:10:02 +0000 (12:10 +0000)
committerDan Poltawski <dan@moodle.com>
Thu, 28 Jan 2016 08:27:30 +0000 (08:27 +0000)
commit5cc5f31101847a10d1fb8f4ac5b109f65ca0a880
tree374c96fe2ad117c15f4d4e800a78047359e5324e
parentdbf6b407829b1e89198a908ce99709943a5a6eee
MDL-49817 grunt: Refactor the uglify task

This is in preperation for the watch task and doing a few things:

1) Switch away from 'grunt.file.expandMapping' to the declarative syntax
   for doing the same thing, as recommended in docs:
   http://gruntjs.com/api/grunt.file#grunt.file.expandmapping

2) Factor the renaming function into shared function so it can be used
   from the watch task too.

3) Shared the file glob'ing pattern for match AMD js files between
   jshint and uglify task (this removes the node_modules exception..
   we should add it to both if we need it).

4) Rename the task configuration - I am just doing this because it looks
   like 'dynamic_mappings' is some how magic config option when you
   look at the manual:
   http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically

   But in fact, it's just a task confguration name.
Gruntfile.js