From bd19966cabcaec77afce254b3c023b6cc9d86d9c Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Thu, 4 Dec 2014 18:34:35 -0500 Subject: [PATCH] Tweaking browserify setup to get all es6 features working Currently getting an error about $traceurRuntime being undefined while running Karma tests. This will need to be investigated. --- config.js | 5 ++--- gulpfile.js | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config.js b/config.js index 332046e..6cf96f4 100644 --- a/config.js +++ b/config.js @@ -1,5 +1,6 @@ var path = require('path'), _ = require('lodash'), + es6ify = require('es6ify'), buildRoot = process.env.BUILD_PATH || './build', buildPath = _.bind(path.join, path, buildRoot); @@ -25,10 +26,8 @@ module.exports = { basedir: './src/js', debug: true, fullPaths: false, + entries: [es6ify.runtime], prebundle: function(bundle) { - var es6ify = require('es6ify'); - - bundle.add(es6ify.runtime); bundle.transform(require('./lib/canopy-transform')); bundle.transform(es6ify.configure(/^(?!.*node_modules)+.+\.js$/)); } diff --git a/gulpfile.js b/gulpfile.js index 44e4260..cbdb81e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -66,10 +66,10 @@ gulp.task('browserify', function() { .pipe(tap(function(file) { var bundler = browserify(config.browserify); - bundler.add(file.path); - config.browserify.prebundle(bundler); + bundler.add(file.path); + file.contents = bundler.bundle(); })) .pipe(transform(function() {