Skip to content

Commit

Permalink
0.2.3:
Browse files Browse the repository at this point in the history
- Updated dependencies
- Removed custom browserify error handler
- Replaced deprecated gulp-util with fancy-log and ansi colors
  • Loading branch information
michaelx committed Jul 24, 2018
1 parent 43587b1 commit 1ee1924
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 32 deletions.
2 changes: 1 addition & 1 deletion gulp/tasks/development/responsive-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ gulp.task('responsive-images', function() {
.pipe(changed(config.dest))

.pipe(imageResize(config.options))
.pipe(rename(function (path) { path.basename += config.outputSuffix; }))
.pipe(rename(function(path) { path.basename += config.outputSuffix; }))
.pipe(gulp.dest(config.dest));
});
10 changes: 8 additions & 2 deletions gulp/tasks/development/scripts-browserify.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ var browsersync = require('browser-sync');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var watchify = require('watchify');
var log = require('fancy-log');
var bundleLogger = require('../../util/bundleLogger');
var handleErrors = require('../../util/handleErrors');

function onError(err) {
log('\x1b[31m' + 'Browserify Error:', err.message, '\x1b[0m');
// Keep gulp from hanging on this task
this.emit('end');
}


// Run JavaScript through Browserify
Expand Down Expand Up @@ -36,7 +42,7 @@ gulp.task('scripts-browserify', function(callback) {
return bundler
.bundle()
// Report compile errors
.on('error', handleErrors)
.on('error', onError)
// Use vinyl-source-stream to make the
// stream gulp compatible. Specifiy the
// desired output filename here.
Expand Down
3 changes: 2 additions & 1 deletion gulp/tasks/development/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ var plumber = require('gulp-plumber');
var sourcemaps = require('gulp-sourcemaps');
var browsersync = require('browser-sync');

function onError (err) {
function onError(err) {
console.log(err);
// Keep gulp from hanging on this task
this.emit('end');
}

Expand Down
3 changes: 2 additions & 1 deletion gulp/tasks/production/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ var cssnano = require('cssnano');
var plumber = require('gulp-plumber');
var browsersync = require('browser-sync');

function onError (err) {
function onError(err) {
console.log(err);
// Keep gulp from hanging on this task
this.emit('end');
}

Expand Down
12 changes: 5 additions & 7 deletions gulp/util/bundleLogger.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
/* bundleLogger
------------
Provides gulp style logs to the bundle method in browserify.js
*/
// Provides gulp style logs to the bundle method in browserify.js

var gutil = require('gulp-util');
var log = require('fancy-log');
var prettyHrtime = require('pretty-hrtime');
var startTime;


module.exports = {
start: function(filepath) {
startTime = process.hrtime();
gutil.log('Bundling', gutil.colors.green(filepath));
log('Bundling\x1b[32m', filepath, '\x1b[0m');
},

end: function(filepath) {
var taskTime = process.hrtime(startTime);
var prettyTime = prettyHrtime(taskTime);
gutil.log('Bundled', gutil.colors.green(filepath), 'in', gutil.colors.magenta(prettyTime));
log('Bundled\x1b[32m', filepath, '\x1b[0m' + 'after' + '\x1b[35m', prettyTime, '\x1b[0m');
}
};
15 changes: 0 additions & 15 deletions gulp/util/handleErrors.js

This file was deleted.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "gulp-jekyll",
"version": "0.2.2",
"version": "0.2.3",
"description": "The build process for gulp-jekyll",
"author": "Michael Xander",
"repository": "michaelx/gulp-jekyll",
"devDependencies": {
"browser-sync": "^2.24.4",
"browser-sync": "^2.24.6",
"browserify": "^16.2.2",
"browserify-shim": "^3.8.14",
"css-mqpacker": "^6.0.2",
"cssnano": "^3.10.0",
"del": "^3.0.0",
"fancy-log": "^1.3.2",
"gulp": "^3.9.1",
"gulp-base64": "^0.1.3",
"gulp-changed": "^3.2.0",
Expand All @@ -22,11 +23,10 @@
"gulp-jshint": "^2.1.0",
"gulp-jsonlint": "^1.2.1",
"gulp-jsonminify": "^1.1.0",
"gulp-notify": "^3.2.0",
"gulp-plumber": "^1.2.0",
"gulp-postcss": "^7.0.1",
"gulp-pretty-data": "^0.1.2",
"gulp-rename": "^1.3.0",
"gulp-rename": "^1.4.0",
"gulp-rev": "^8.1.1",
"gulp-rev-collector": "^1.3.1",
"gulp-rsync": "0.0.8",
Expand All @@ -39,7 +39,7 @@
"jshint-stylish": "^2.2.1",
"postcss-advanced-variables": "^2.3.3",
"postcss-nested": "^3.0.0",
"postcss-preset-env": "^5.2.0",
"postcss-preset-env": "^5.2.3",
"postcss-reporter": "^5.0.0",
"postcss-uncss": "^0.14.0",
"pretty-hrtime": "^1.0.3",
Expand Down

0 comments on commit 1ee1924

Please sign in to comment.