MDL-62497 javascript: add babel transpiling to Grunt for ES6 support

This commit is contained in:
Ryan Wyllie
2019-07-19 14:12:48 +08:00
committed by Andrew Nicols
parent 67b2262938
commit c53f86d408
10 changed files with 2976 additions and 1055 deletions
+4 -3
View File
@@ -75,9 +75,10 @@ class core_requirejs {
* <componentdir>/amd/src/modulename.js
*
* @param boolean $debug If true, returns the paths to the original (unminified) source files.
* @param boolean $includelazy If true, includes modules with the -lazy suffix.
* @return array $files An array of mappings from module names to file paths.
*/
public static function find_all_amd_modules($debug = false) {
public static function find_all_amd_modules($debug = false, $includelazy = false) {
global $CFG;
$jsdirs = array();
@@ -118,8 +119,8 @@ class core_requirejs {
$extension = $item->getExtension();
if ($extension === 'js') {
$filename = str_replace('.min', '', $item->getBaseName('.js'));
// We skip lazy loaded modules.
if (strpos($filename, '-lazy') === false) {
// We skip lazy loaded modules unless specifically requested.
if ($includelazy || strpos($filename, '-lazy') === false) {
$modulename = $component . '/' . $filename;
$jsfiles[$modulename] = $item->getRealPath();
}