diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index 6d332ef..b797127 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -7,6 +7,7 @@ buffer = require('vinyl-buffer'), browserify = require('browserify'), watchify = require('watchify'), + exorcist = require('exorcist'), handleErrors = require('../util/handleErrors'); // TODO - Concat license header to dev/prod build files. @@ -14,6 +15,7 @@ return this.bundle() .on('error', handleErrors.handler) .pipe(handleErrors()) + .pipe(exorcist(paths.out + '/pixi.js.map')) .pipe(source('pixi.js')) .pipe(gulp.dest(paths.out)) .pipe(buffer()) diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index 6d332ef..b797127 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -7,6 +7,7 @@ buffer = require('vinyl-buffer'), browserify = require('browserify'), watchify = require('watchify'), + exorcist = require('exorcist'), handleErrors = require('../util/handleErrors'); // TODO - Concat license header to dev/prod build files. @@ -14,6 +15,7 @@ return this.bundle() .on('error', handleErrors.handler) .pipe(handleErrors()) + .pipe(exorcist(paths.out + '/pixi.js.map')) .pipe(source('pixi.js')) .pipe(gulp.dest(paths.out)) .pipe(buffer()) diff --git a/gulp/util/handleErrors.js b/gulp/util/handleErrors.js index ec784f2..34dc1d0 100644 --- a/gulp/util/handleErrors.js +++ b/gulp/util/handleErrors.js @@ -1,15 +1,19 @@ var gutil = require('gulp-util'), - plumber = require('gulp-plumber'); + plumber = require('gulp-plumber'), + ERROR = gutil.colors.red('[ERROR]'); function errorHandler(err) { - gutil.log(err.stack || err); - // var args = [].slice.apply(arguments); + var msg = err.toString(); - // // Send error to notification center with gulp-notify - // notify.onError({ - // title: 'Error', - // message: '<' + '%= error.message %' + '>' - // }).apply(this, args); + if (msg === '[object Object]') { + msg = err; + } + + gutil.log(ERROR, err); + + if (err.stack) { + gutil.log(ERROR, err.stack); + } // Keep gulp from hanging on this task this.emit('end'); @@ -19,4 +23,4 @@ return plumber(errorHandler); }; -module.exports.handler = errorHandler; \ No newline at end of file +module.exports.handler = errorHandler; diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index 6d332ef..b797127 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -7,6 +7,7 @@ buffer = require('vinyl-buffer'), browserify = require('browserify'), watchify = require('watchify'), + exorcist = require('exorcist'), handleErrors = require('../util/handleErrors'); // TODO - Concat license header to dev/prod build files. @@ -14,6 +15,7 @@ return this.bundle() .on('error', handleErrors.handler) .pipe(handleErrors()) + .pipe(exorcist(paths.out + '/pixi.js.map')) .pipe(source('pixi.js')) .pipe(gulp.dest(paths.out)) .pipe(buffer()) diff --git a/gulp/util/handleErrors.js b/gulp/util/handleErrors.js index ec784f2..34dc1d0 100644 --- a/gulp/util/handleErrors.js +++ b/gulp/util/handleErrors.js @@ -1,15 +1,19 @@ var gutil = require('gulp-util'), - plumber = require('gulp-plumber'); + plumber = require('gulp-plumber'), + ERROR = gutil.colors.red('[ERROR]'); function errorHandler(err) { - gutil.log(err.stack || err); - // var args = [].slice.apply(arguments); + var msg = err.toString(); - // // Send error to notification center with gulp-notify - // notify.onError({ - // title: 'Error', - // message: '<' + '%= error.message %' + '>' - // }).apply(this, args); + if (msg === '[object Object]') { + msg = err; + } + + gutil.log(ERROR, err); + + if (err.stack) { + gutil.log(ERROR, err.stack); + } // Keep gulp from hanging on this task this.emit('end'); @@ -19,4 +23,4 @@ return plumber(errorHandler); }; -module.exports.handler = errorHandler; \ No newline at end of file +module.exports.handler = errorHandler; diff --git a/package.json b/package.json index c96628a..bbbd2f6 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "browserify": "^8.0.2", "chai": "^1.10.0", "del": "^1.1.0", + "exorcist": "^0.1.6", "gulp": "^3.8.10", "gulp-cached": "^1.0.1", "gulp-concat": "^2.5.2",