Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
webpack(wparg).run(function(err, stats) {
if (err !== null) {
throw new gutil.PluginError('webpack', err);
}
var statsString = stats.toString({chunks: false});
if (stats.hasErrors() === true) {
throw new gutil.PluginError('webpack', statsString);
}
gutil.log('[webpack]', statsString);
callback();
});
});
function logErr(message) {
var rest = [];
for (var _i = 1; _i < arguments.length; _i++) {
rest[_i - 1] = arguments[_i];
}
util.log(util.colors.red('[monaco.d.ts]'), 'WHILE HANDLING RULE: ', CURRENT_PROCESSING_RULE);
util.log.apply(util, [util.colors.red('[monaco.d.ts]'), message].concat(rest));
}
function moduleIdToPath(out, moduleId) {
function handler(err, stats) {
if (err) {
return callback(new gulpUtil.PluginError('webpack', err));
}
if (global.parameters.argv.verbose) {
gulpUtil.log('[webpack]', stats.toString({colors: true}));
}
if (!started) {
started = true;
return callback();
}
}
function logError(err) {
if (err.fileName) {
gutil.log(gutil.colors.red('Error'), err.fileName, lookupErrorLine(err));
} else if (err.message) {
gutil.log(gutil.colors.red('Error'), err.message);
} else {
gutil.log(gutil.colors.red('Error'), err);
}
}
server.close(function() {
gutil.log('backup-generator:', 'backups saved: ', gutil.colors.cyan(numSaved), 'backups skipped: ', gutil.colors.magenta(numSkipped), 'backups failed: ', gutil.colors.red(numFailed));
cb();
});
});
gulp.task('start', function () {
setEnv();
setVersion();
setPaths();
gutil.log(gutil.colors.green('------------------------------'));
gutil.log(gutil.colors.green('-'), ' Env:', gutil.colors.yellow(config.env));
gutil.log(gutil.colors.green('-'), ' Debug:', gutil.colors.yellow(config.debug));
gutil.log(gutil.colors.green('-'), 'Version:', gutil.colors.yellow(config.version));
gutil.log(gutil.colors.green('------------------------------'));
});
files.forEach((file, index) => {
const size = index
? gutil.colors.red(file.contents.byteLength)
: gutil.colors.green(file.contents.byteLength);
gutil.log(gutil.colors.magenta(path.basename(file.path)), size);
});
logFileEvent: function(event, path) {
path = separatePath(path);
gutil.log('change in',
gutil.colors.magenta(path.dir),
gutil.colors.white('-'),
gutil.colors.cyan(event),
gutil.colors.yellow(path.file)
);
},
logFileEvent: (event, path) => {
const pathObject = separatePath(path);
gutil.log('change in',
gutil.colors.magenta(pathObject.dir),
gutil.colors.white('-'),
gutil.colors.cyan(event),
gutil.colors.yellow(pathObject.file),
);
},
function printMsg(originalFile, optimizedFile, verbose) {
var originalSize = originalFile.contents.length;
var optimizedSize = optimizedFile.contents.length;
var saved = originalSize - optimizedSize;
var percent = originalSize > 0 ? (saved / originalSize) * 100 : 0;
var savedMsg = 'saved ' + prettyBytes(saved) + ' - ' + percent.toFixed(1).replace(/\.0$/, '') + '%';
var msg = saved > 0 ? savedMsg : 'already optimized';
var optimizedType = (path.extname(optimizedFile.path) || path.extname(originalFile.path)).toLowerCase();
if (verbose) {
msg = chalk.green('✔ ') + originalFile.relative + ' -> ' + optimizedType + chalk.gray(' (' + msg + ')');
gutil.log('gulp-fontmin:', msg);
}
}