From 7d9721bd063c9f43e6f2e3dd3a9e6ab42fe1c51c Mon Sep 17 00:00:00 2001 From: Tommaso Ricci Date: Thu, 11 Aug 2016 12:24:33 +0200 Subject: [PATCH] Fix #49 - watch multiple bundles conflict For more details about the bug see here: https://github.com/driftyco/ionic-gulp-tasks/issues/49 --- browserify-es2015/index.js | 51 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/browserify-es2015/index.js b/browserify-es2015/index.js index dac6c3e..f866be6 100644 --- a/browserify-es2015/index.js +++ b/browserify-es2015/index.js @@ -12,34 +12,33 @@ var gulp = require('gulp'), uglify = require('gulp-uglify'), stream = require('stream'); - -var defaultOptions = { - watch: false, - src: './app/app.js', - outputPath: 'www/build/js/', - outputFile: 'app.bundle.js', - minify: false, - browserifyOptions: { - cache: {}, - packageCache: {}, - debug: true - }, - watchifyOptions: {}, - babelifyOptions: { - presets: [babelES2015Preset], - plugins: [babelDecoratorsTransform] - }, - uglifyOptions: {}, - onError: function(err){ - console.error(err.toString()); - this.emit('end'); - }, - onLog: function(log){ - console.log((log = log.split(' '), log[0] = pretty(log[0]), log.join(' '))); +module.exports = function(options) { + var defaultOptions = { + watch: false, + src: './app/app.js', + outputPath: 'www/build/js/', + outputFile: 'app.bundle.js', + minify: false, + browserifyOptions: { + cache: {}, + packageCache: {}, + debug: true + }, + watchifyOptions: {}, + babelifyOptions: { + presets: [babelES2015Preset], + plugins: [babelDecoratorsTransform] + }, + uglifyOptions: {}, + onError: function(err){ + console.error(err.toString()); + this.emit('end'); + }, + onLog: function(log){ + console.log((log = log.split(' '), log[0] = pretty(log[0]), log.join(' '))); + } } -} -module.exports = function(options) { options = merge(defaultOptions, options); var b = browserify(options.src, options.browserifyOptions)