Commit 5a2902c5 authored by Robert Knight's avatar Robert Knight

Enable ES2015 transpilation in client

Enable use of ES6 language features via Babel in the sidebar app and
annotator code.

 - Update Babelify to the current version
 - Add preset for transpiling ES2015
parent 2a99b84b
{
"presets": ["es2015"],
"ignore": "**/vendor/*"
}
......@@ -102,17 +102,18 @@ var appBundles = [{
// by the client.
name: 'boot',
entry: './src/boot/index',
transforms: ['babel'],
},{
// The sidebar application for displaying and editing annotations.
name: 'app',
transforms: ['coffee'],
transforms: ['babel', 'coffee'],
entry: './src/sidebar/app',
},{
// The annotation layer which handles displaying highlights, presenting
// annotation tools on the page and instantiating the sidebar application.
name: 'injector',
entry: './src/annotator/main',
transforms: ['coffee'],
transforms: ['babel', 'coffee'],
}];
var appBundleConfigs = appBundles.map(function (config) {
......
......@@ -17,7 +17,8 @@
"angulartics": "0.17.2",
"autofill-event": "0.0.1",
"autoprefixer": "^6.0.3",
"babelify": "^6.1.3",
"babel-preset-es2015": "^6.24.0",
"babelify": "^7.3.0",
"browserify": "^13.0.0",
"browserify-istanbul": "^2.0.0",
"browserify-ngannotate": "^1.0.1",
......
......@@ -6,6 +6,7 @@
var fs = require('fs');
var path = require('path');
var babelify = require('babelify');
var browserify = require('browserify');
var coffeeify = require('coffeeify');
var exorcist = require('exorcist');
......@@ -163,6 +164,9 @@ module.exports = function createBundle(config, buildOpts) {
if (transform === 'coffee') {
bundle.transform(coffeeify);
}
if (transform === 'babel') {
bundle.transform(babelify);
}
});
if (config.minify) {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment