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.
Prior to this change all Grunt features were in a single Gruntfile.js
but this has become difficult to manage and maintain.
This commit moves the existing dependencies for component calculation
and babel moduel definition into a new .grunt directory, and
restructures the existing tasks in Gruntfile.js into separate task
configuration files.
This improves the maintainability of the Grunt build system and allows
for easier future expansion.
2021-03-19 12:56:35 +08:00
Renamed from babel-plugin-add-module-to-define.js (Browse further)