GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/Student/JimMartinson/Lab12/drupal/core/scripts/js/ |
Upload File : |
/** * @file * * Compile *.es6.js files to ES5. * * @internal This file is part of the core javascript build process and is only * meant to be used in that context. */ 'use strict'; const fs = require('fs'); const path = require('path'); const babel = require('babel-core'); const glob = require('glob'); // Logging human-readable timestamp. const log = function (message) { // eslint-disable-next-line no-console console.log(`[${new Date().toTimeString().slice(0, 8)}] ${message}`); }; function addSourceMappingUrl(code, loc) { return code + '\n\n//# sourceMappingURL=' + path.basename(loc); } const changedOrAdded = (filePath) => { babel.transformFile(filePath, { sourceMaps: true, comments: false }, function (err, result) { const fileName = filePath.slice(0, -7); // we've requested for a sourcemap to be written to disk let mapLoc = `${fileName}.js.map`; fs.writeFile(mapLoc, JSON.stringify(result.map)); fs.writeFile(`${fileName}.js`, addSourceMappingUrl(result.code, mapLoc)); log(`'${filePath}' is being processed.`); }); }; const fileMatch = './**/*.es6.js'; const globOptions = { ignore: 'node_modules/**' }; const processFiles = (error, filePaths) => { if (error) { process.exitCode = 1; } filePaths.forEach(changedOrAdded); }; glob(fileMatch, globOptions, processFiles); process.exitCode = 0;