gulp-log2console is a gulp plugin which add console logging into your JS files.
$ npm install --save-dev gulp-log2console
var gulp = require('gulp');
var log2console = require('gulp-log2console');
gulp.task('log2console', function () {
gulp.src('dist/**/*.js')
.pipe(log2console('My custom message', { logType: 'warn' }))
.pipe(gulp.dest('dist'));
});
- logType (string) : type of logging - (log (default), info, warn, error)
- useStrict (bool) : add 'use strict' into the IIFE function (default false)
- trimCode (bool) : inline code (default true)
- prependSemicolon (bool) : add a semicolon before the IIFE (default false)