Andrew Nicols c1e639c41a MDL-71882 grunt: Replace module names
When a third-party AMD module is provided with an included name we must
replace it with a name that we are able to use.

The structure of an AMD module define function is:

    [name], [dependencies], [callback]
    String, Array,          Function

Each of these is (strangely) optional.

We know that the name is the only String and will always be the first,
and we can use AST to remove a provided name before adding the
Moodle-specific name.

This should be a safe change and not lead to any changes in built code,
but will make it easier to include third-party code.

An additional logging line is also included to inform developers that a
change was made.
2021-11-17 09:16:55 +08:00
..