Switching to Babel instead of es6ify

This commit is contained in:
Jeff Avallone 2015-11-01 06:50:57 -05:00
parent 025636d559
commit 445996744a
5 changed files with 12 additions and 15 deletions

3
.babelrc Normal file
View File

@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}

View File

@ -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$/));
}
};

View File

@ -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();
}))

View File

@ -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)
});

View File

@ -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",