From c22eccb631411cca97b8acd1d146d2ebf65b4ae4 Mon Sep 17 00:00:00 2001
From: Glenn Vorhes <gavorhes@wisc.edu>
Date: Wed, 11 May 2016 15:04:39 -0500
Subject: [PATCH] move browserify, babelify config back into function with
 global flag

---
 lib/gulp-helpers.js | 13 ++++++++++++-
 package.json        | 14 --------------
 projects/itsMap.js  |  5 +++++
 src/gulp-helpers.js |  9 ++++++++-
 4 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/lib/gulp-helpers.js b/lib/gulp-helpers.js
index f1b2620..46ce8a9 100644
--- a/lib/gulp-helpers.js
+++ b/lib/gulp-helpers.js
@@ -70,7 +70,18 @@ function bundleEs2015(inputFile, outFile, production) {
         inputFile = glob.sync('./spec/**/*.js');
     }
 
-    var bundler = browserify(inputFile);
+    var bundler = browserify({
+        entries: inputFile,
+        cache: {},
+        packageCache: {},
+        debug: true
+    });
+
+    bundler.transform(babelify.configure({
+        global: true,
+        presets: ["es2015"],
+        ignore: /ol\-build\.js|jquery\.min|\/node_modules\/(?!webmapsjs\/)/
+    }));
 
     if (!production) {
         bundler = watchify(bundler);
diff --git a/package.json b/package.json
index 31b4390..a50eaef 100644
--- a/package.json
+++ b/package.json
@@ -60,19 +60,5 @@
     "vinyl-buffer": "^1.0.0",
     "vinyl-source-stream": "^1.1.0",
     "watchify": "^3.7.0"
-  },
-  "browserify": {
-    "debug": true,
-    "transform": [
-      [
-        "babelify",
-        {
-          "presets": [
-            "es2015"
-          ],
-          "ignore": ["ol-build.js",  "jquery.min"]
-        }
-      ]
-    ]
   }
 }
diff --git a/projects/itsMap.js b/projects/itsMap.js
index bab4a7c..3e6beac 100644
--- a/projects/itsMap.js
+++ b/projects/itsMap.js
@@ -24,3 +24,8 @@ let layerArray = [
 ];
 
 let legend = new LayerLegend(layerArray, 'legend-container', {});
+
+
+
+
+
diff --git a/src/gulp-helpers.js b/src/gulp-helpers.js
index 64fa781..567560a 100644
--- a/src/gulp-helpers.js
+++ b/src/gulp-helpers.js
@@ -67,10 +67,17 @@ export function bundleEs2015(inputFile, outFile, production) {
         {
             entries: inputFile,
             cache: {},
-            packageCache: {}
+            packageCache: {},
+            debug: true
         }
     );
 
+    bundler.transform(babelify.configure({
+        global: true,
+        presets: ["es2015"],
+        ignore: /ol\-build\.js|jquery\.min|\/node_modules\/(?!webmapsjs\/)/
+    }));
+
     if (!production) {
         bundler = watchify(bundler);
     }
-- 
GitLab