Chris@0: /** Chris@0: * @file Chris@0: * Chris@0: * Provides the build:js command to compile *.es6.js files to ES5. Chris@0: * Chris@0: * Run build:js with --file to only parse a specific file. Using the --check Chris@0: * flag build:js can be run to check if files are compiled correctly. Chris@0: * @example Only process misc/drupal.es6.js and misc/drupal.init.es6.jsCheck if all files have been compiled correctly { Chris@0: if (error) { Chris@0: process.exitCode = 1; Chris@0: } Chris@0: // Process all the found files. Chris@0: let callback = changeOrAdded; Chris@0: if (argv.check) { Chris@0: callback = check; Chris@0: } Chris@0: filePaths.forEach(callback); Chris@0: }; Chris@0: Chris@0: if (argv.file) { Chris@0: processFiles(null, [].concat(argv.file)); Chris@0: } Chris@0: else { Chris@0: glob(fileMatch, globOptions, processFiles); Chris@0: } Chris@0: process.exitCode = 0;