From 445996744af1387a7e81ee65167487f0e8837782 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sun, 1 Nov 2015 06:50:57 -0500 Subject: [PATCH] Switching to Babel instead of es6ify --- .babelrc | 3 +++ config.js | 6 ------ gulpfile.js | 9 ++++----- karma.conf.js | 6 +++--- package.json | 3 ++- 5 files changed, 12 insertions(+), 15 deletions(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..c13c5f6 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} diff --git a/config.js b/config.js index 94660fd..ba8d976 100644 --- a/config.js +++ b/config.js @@ -1,6 +1,5 @@ var path = require('path'), _ = require('lodash'), - es6ify = require('es6ify'), buildRoot = process.env.BUILD_PATH || './build', buildPath = _.bind(path.join, path, buildRoot); @@ -20,10 +19,5 @@ module.exports = { browserify: { debug: true, fullPaths: false, - entries: [es6ify.runtime], - }, - prebundle: function(bundle) { - bundle.transform(require('./lib/canopy-transform')); - bundle.transform(es6ify.configure(/^(?!.*node_modules)+.+\.js$/)); } }; diff --git a/gulpfile.js b/gulpfile.js index b29e5a6..97ac133 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -104,11 +104,10 @@ gulp.task('scripts', function() { return gulp.src('./src/js/main.js', { read: false }) .pipe(errorHandler()) .pipe(tap(function(file) { - var bundler = browserify(config.browserify); - - config.prebundle(bundler); - - bundler.add(file.path); + var bundler = browserify(config.browserify) + .transform(require('./lib/canopy-transform')) + .transform(require('babelify')) + .add(file.path); file.contents = bundler.bundle(); })) diff --git a/karma.conf.js b/karma.conf.js index 5c62907..81932f2 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -3,7 +3,6 @@ var _ = require('lodash'), module.exports = function(karma) { var globs = _.flatten([ - require('es6ify').runtime, // Hack to get traceurRuntime in the build config.globs.js, config.globs.spec ]); @@ -22,8 +21,9 @@ module.exports = function(karma) { autoWatch: true, singleRun: false, browserify: _.extend({ - configure: function(bundle) { - config.prebundle(bundle); + configure: function(bundler) { + bundler.transform(require('./lib/canopy-transform')); + bundler.transform(require('babelify')); } }, config.browserify) }); diff --git a/package.json b/package.json index 71ed2f6..ded7214 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,10 @@ "license": "MIT", "private": true, "devDependencies": { + "babel-preset-es2015": "^6.0.14", + "babelify": "^7.1.0", "browserify": "^12.0.1", "canopy": "^0.2.0", - "es6ify": "^1.5.1", "folder-toc": "^0.1.0", "gulp": "^3.8.10", "gulp-connect": "^2.2.0",